From 879ddb30745a64fd5c6702666ef6efbdf5159615 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 9 Dec 2024 14:21:56 +0900 Subject: [PATCH 01/29] Implement SDK Method Multiplexing --- app/config/specs/open-api3-latest-client.json | 16 ++++++++++++++++ app/config/specs/open-api3-latest-console.json | 16 ++++++++++++++++ app/config/specs/open-api3-latest-server.json | 16 ++++++++++++++++ app/config/specs/swagger2-latest-client.json | 16 ++++++++++++++++ app/config/specs/swagger2-latest-console.json | 16 ++++++++++++++++ app/config/specs/swagger2-latest-server.json | 16 ++++++++++++++++ app/controllers/api/databases.php | 11 ++++++++++- src/Appwrite/Specification/Format/OpenAPI3.php | 10 +++++++++- src/Appwrite/Specification/Format/Swagger2.php | 9 +++++++++ 9 files changed, 124 insertions(+), 2 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 55be1565b7..0320b7b140 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4571,6 +4571,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a98e06dc69..88e57cf635 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8140,6 +8140,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 2c1e276c07..345d4e49f9 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7667,6 +7667,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [], "Session": [] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 8dce505cac..627039714a 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4739,6 +4739,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index a09e8999fb..20f6bad540 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8295,6 +8295,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index d0d6eb530d..8eb9af6284 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7809,6 +7809,22 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": { + "createDocument": { + "parameters": [ + "documentId", + "data", + "permissions" + ], + "response": "document" + }, + "createDocuments": { + "parameters": [ + "documents" + ], + "response": "documentList" + } + }, "auth": { "Project": [], "Session": [] diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 593e3b39d9..4fcdefde01 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2854,7 +2854,16 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createDocument') + ->label('sdk.method', [ + 'createDocument' => [ + 'parameters' => ['documentId', 'data', 'permissions'], + 'response' => Response::MODEL_DOCUMENT, + ], + 'createDocuments' => [ + 'parameters' => ['documents'], + 'response' => Response::MODEL_DOCUMENT_LIST, + ], + ]) ->label('sdk.description', '/docs/references/databases/create-document.md') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index f7430ec70e..4dc6e222e0 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -122,8 +122,12 @@ class OpenAPI3 extends Format $scope = $route->getLabel('scope', ''); $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; - $method = $route->getLabel('sdk.method', \uniqid()); + + if (!empty($method) && is_array($method)) { + $method = array_keys($method)[0]; + } + $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; $produces = $route->getLabel('sdk.response.type', null); $model = $route->getLabel('sdk.response.model', 'none'); @@ -178,6 +182,10 @@ class OpenAPI3 extends Format ], ]; + if (is_array($route->getLabel('sdk.method', ''))) { + $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + } + foreach ($this->models as $value) { if (\is_array($model)) { $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index f2e324c71f..d9d2307e07 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -121,6 +121,11 @@ class Swagger2 extends Format $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; $method = $route->getLabel('sdk.method', \uniqid()); + + if (!empty($method) && is_array($method)) { + $method = array_keys($method)[0]; + } + $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; $produces = $route->getLabel('sdk.response.type', null); $model = $route->getLabel('sdk.response.model', 'none'); @@ -181,6 +186,10 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } + if (is_array($route->getLabel('sdk.method', ''))) { + $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + } + foreach ($this->models as $value) { if (\is_array($model)) { $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); From e9c2ebbcf5af7ec15128029adda1d9ef22e74589 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 10 Dec 2024 12:31:26 +0900 Subject: [PATCH 02/29] Implement SDK Multiplexing for Create Document/s --- app/config/specs/open-api3-latest-client.json | 26 ++++++++++++++++--- .../specs/open-api3-latest-console.json | 26 ++++++++++++++++--- app/config/specs/open-api3-latest-server.json | 26 ++++++++++++++++--- app/config/specs/swagger2-latest-client.json | 26 ++++++++++++++++--- app/config/specs/swagger2-latest-console.json | 26 ++++++++++++++++--- app/config/specs/swagger2-latest-server.json | 26 ++++++++++++++++--- app/controllers/api/databases.php | 18 ++++++++++--- docs/references/databases/create-documents.md | 1 + .../Specification/Format/Swagger2.php | 7 +++++ 9 files changed, 155 insertions(+), 27 deletions(-) create mode 100644 docs/references/databases/create-documents.md diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 0320b7b140..b95a279a05 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4540,11 +4540,18 @@ "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.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "oneOf": [ + { + "$ref": "#\/components\/schemas\/document" + }, + { + "$ref": "#\/components\/schemas\/documentList" + } + ] } } } @@ -4573,18 +4580,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 88e57cf635..31d3850c49 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8109,11 +8109,18 @@ "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.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "oneOf": [ + { + "$ref": "#\/components\/schemas\/document" + }, + { + "$ref": "#\/components\/schemas\/documentList" + } + ] } } } @@ -8142,18 +8149,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 345d4e49f9..11f1f40aac 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7636,11 +7636,18 @@ "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.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/document" + "oneOf": [ + { + "$ref": "#\/components\/schemas\/document" + }, + { + "$ref": "#\/components\/schemas\/documentList" + } + ] } } } @@ -7669,18 +7676,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 627039714a..eed10f9f38 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4712,9 +4712,16 @@ "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.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "schema": { - "$ref": "#\/definitions\/document" + "x-oneOf": [ + { + "$ref": "#\/definitions\/document" + }, + { + "$ref": "#\/definitions\/documentList" + } + ] } } }, @@ -4741,18 +4748,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "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." }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "Create a batch of 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": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 20f6bad540..8fd21bc7ef 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8268,9 +8268,16 @@ "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.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "schema": { - "$ref": "#\/definitions\/document" + "x-oneOf": [ + { + "$ref": "#\/definitions\/document" + }, + { + "$ref": "#\/definitions\/documentList" + } + ] } } }, @@ -8297,18 +8304,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "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." }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "Create a batch of 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": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 8eb9af6284..b82a08e255 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7782,9 +7782,16 @@ "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.", "responses": { "201": { - "description": "Document", + "description": "Document, or Documents List", "schema": { - "$ref": "#\/definitions\/document" + "x-oneOf": [ + { + "$ref": "#\/definitions\/document" + }, + { + "$ref": "#\/definitions\/documentList" + } + ] } } }, @@ -7811,18 +7818,29 @@ "offline-response-key": "$id", "multiplex": { "createDocument": { + "name": "Create Document", "parameters": [ "documentId", "data", "permissions" ], - "response": "document" + "required": [ + "documentId", + "data" + ], + "response": "document", + "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." }, "createDocuments": { + "name": "Create Documents", "parameters": [ "documents" ], - "response": "documentList" + "required": [ + "documents" + ], + "response": "documentList", + "description": "Create a batch of 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": { diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4fcdefde01..4de4c4420e 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2856,18 +2856,30 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('sdk.namespace', 'databases') ->label('sdk.method', [ 'createDocument' => [ - 'parameters' => ['documentId', 'data', 'permissions'], + 'name' => 'Create Document', + 'parameters' => [ + 'documentId', + 'data', + 'permissions', + ], + 'required' => ['documentId', 'data'], 'response' => Response::MODEL_DOCUMENT, + 'description' => '/docs/references/databases/create-document.md', ], 'createDocuments' => [ - 'parameters' => ['documents'], + 'name' => 'Create Documents', + 'parameters' => [ + 'documents' + ], + 'required' => ['documents'], 'response' => Response::MODEL_DOCUMENT_LIST, + 'description' => '/docs/references/databases/create-documents.md' ], ]) ->label('sdk.description', '/docs/references/databases/create-document.md') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) + ->label('sdk.response.model', [Response::MODEL_DOCUMENT, Response::MODEL_DOCUMENT_LIST]) ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') ->label('sdk.offline.key', '{documentId}') ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/docs/references/databases/create-documents.md b/docs/references/databases/create-documents.md new file mode 100644 index 0000000000..6428108d28 --- /dev/null +++ b/docs/references/databases/create-documents.md @@ -0,0 +1 @@ +Create a batch of 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. \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index d9d2307e07..a6cb9d1e5c 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -188,6 +188,13 @@ class Swagger2 extends Format if (is_array($route->getLabel('sdk.method', ''))) { $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + + foreach ($temp['x-appwrite']['multiplex'] as $key => $value) { + if (!empty($value['description'])) { + $desc = \realpath(__DIR__ . '/../../../../' . $value['description']); + $temp['x-appwrite']['multiplex'][$key]['description'] = $desc ? \file_get_contents($desc) : ''; + } + } } foreach ($this->models as $value) { From f7e69624c60a6c32fbad54722676e22c98b88d08 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 11 Dec 2024 10:19:10 +0900 Subject: [PATCH 03/29] Address comments --- app/config/specs/open-api3-latest-client.json | 2 +- app/config/specs/open-api3-latest-console.json | 2 +- app/config/specs/open-api3-latest-server.json | 2 +- app/config/specs/swagger2-latest-client.json | 6 +++--- app/config/specs/swagger2-latest-console.json | 6 +++--- app/config/specs/swagger2-latest-server.json | 6 +++--- docs/references/databases/create-document.md | 2 +- docs/references/databases/create-documents.md | 1 - src/Appwrite/Specification/Format/Swagger2.php | 7 ------- 9 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 docs/references/databases/create-documents.md diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index b95a279a05..7f79d5e87b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4537,7 +4537,7 @@ "tags": [ "databases" ], - "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.", + "description": "Create 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.", "responses": { "201": { "description": "Document, or Documents List", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 31d3850c49..8b2a800291 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8106,7 +8106,7 @@ "tags": [ "databases" ], - "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.", + "description": "Create 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.", "responses": { "201": { "description": "Document, or Documents List", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 11f1f40aac..388b9bb30d 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7633,7 +7633,7 @@ "tags": [ "databases" ], - "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.", + "description": "Create 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.", "responses": { "201": { "description": "Document, or Documents List", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index eed10f9f38..e736f20227 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4709,7 +4709,7 @@ "tags": [ "databases" ], - "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.", + "description": "Create 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.", "responses": { "201": { "description": "Document, or Documents List", @@ -4759,7 +4759,7 @@ "data" ], "response": "document", - "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." + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { "name": "Create Documents", @@ -4770,7 +4770,7 @@ "documents" ], "response": "documentList", - "description": "Create a batch of 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." + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 8fd21bc7ef..dcec505131 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8265,7 +8265,7 @@ "tags": [ "databases" ], - "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.", + "description": "Create 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.", "responses": { "201": { "description": "Document, or Documents List", @@ -8315,7 +8315,7 @@ "data" ], "response": "document", - "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." + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { "name": "Create Documents", @@ -8326,7 +8326,7 @@ "documents" ], "response": "documentList", - "description": "Create a batch of 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." + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index b82a08e255..fc252c40ea 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7779,7 +7779,7 @@ "tags": [ "databases" ], - "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.", + "description": "Create 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.", "responses": { "201": { "description": "Document, or Documents List", @@ -7829,7 +7829,7 @@ "data" ], "response": "document", - "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." + "description": "\/docs\/references\/databases\/create-document.md" }, "createDocuments": { "name": "Create Documents", @@ -7840,7 +7840,7 @@ "documents" ], "response": "documentList", - "description": "Create a batch of 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." + "description": "\/docs\/references\/databases\/create-documents.md" } }, "auth": { diff --git a/docs/references/databases/create-document.md b/docs/references/databases/create-document.md index a2444d58a4..a02d7c8bf1 100644 --- a/docs/references/databases/create-document.md +++ b/docs/references/databases/create-document.md @@ -1 +1 @@ -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. \ No newline at end of file +Create 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. \ No newline at end of file diff --git a/docs/references/databases/create-documents.md b/docs/references/databases/create-documents.md deleted file mode 100644 index 6428108d28..0000000000 --- a/docs/references/databases/create-documents.md +++ /dev/null @@ -1 +0,0 @@ -Create a batch of 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. \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index a6cb9d1e5c..d9d2307e07 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -188,13 +188,6 @@ class Swagger2 extends Format if (is_array($route->getLabel('sdk.method', ''))) { $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); - - foreach ($temp['x-appwrite']['multiplex'] as $key => $value) { - if (!empty($value['description'])) { - $desc = \realpath(__DIR__ . '/../../../../' . $value['description']); - $temp['x-appwrite']['multiplex'][$key]['description'] = $desc ? \file_get_contents($desc) : ''; - } - } } foreach ($this->models as $value) { From b4c77fbd5fc037d2270d3dda3ddafa79b4bc4d54 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 16 Dec 2024 14:59:01 +0900 Subject: [PATCH 04/29] Get Initial Draft Working --- app/config/specs/open-api3-latest-client.json | 237 ++--- .../specs/open-api3-latest-console.json | 287 +++--- app/config/specs/open-api3-latest-server.json | 246 ++---- app/config/specs/swagger2-latest-client.json | 267 +++--- app/config/specs/swagger2-latest-console.json | 437 ++++----- app/config/specs/swagger2-latest-server.json | 361 ++++---- app/controllers/api/account.php | 832 ++++++++++-------- app/controllers/api/avatars.php | 123 +-- app/controllers/api/console.php | 34 +- app/controllers/api/databases.php | 806 +++++++++-------- app/controllers/api/functions.php | 454 ++++++---- app/controllers/api/graphql.php | 69 +- app/controllers/api/health.php | 383 ++++---- app/controllers/api/locale.php | 163 ++-- app/controllers/api/messaging.php | 739 +++++++++------- app/controllers/api/migrations.php | 277 +++--- app/controllers/api/project.php | 96 +- app/controllers/api/projects.php | 688 +++++++++------ app/controllers/api/proxy.php | 80 +- app/controllers/api/storage.php | 245 +++--- app/controllers/api/teams.php | 244 ++--- app/controllers/api/users.php | 679 ++++++++------ app/controllers/api/vcs.php | 178 ++-- app/controllers/mock.php | 4 +- app/controllers/shared/api.php | 13 +- docs/references/account/create-push-target.md | 1 + docs/references/account/delete-push-target.md | 1 + docs/references/account/update-push-target.md | 1 + docs/references/health/get-version.md | 1 + src/Appwrite/GraphQL/Schema.php | 11 +- src/Appwrite/GraphQL/Types/Mapper.php | 9 +- src/Appwrite/Platform/Tasks/Specs.php | 27 +- src/Appwrite/SDK/Method.php | 222 +++++ .../Specification/Format/OpenAPI3.php | 85 +- .../Specification/Format/Swagger2.php | 85 +- 35 files changed, 4635 insertions(+), 3750 deletions(-) create mode 100644 docs/references/account/create-push-target.md create mode 100644 docs/references/account/delete-push-target.md create mode 100644 docs/references/account/update-push-target.md create mode 100644 docs/references/health/get-version.md create mode 100644 src/Appwrite/SDK/Method.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 7f79d5e87b..7de634f988 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -857,10 +857,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -2479,7 +2479,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2499,7 +2499,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2560,7 +2560,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2580,7 +2580,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2640,17 +2640,10 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { @@ -2660,7 +2653,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4531,151 +4524,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "tags": [ - "databases" - ], - "description": "Create 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.", - "responses": { - "201": { - "description": "Document, or Documents List", - "content": { - "application\/json": { - "schema": { - "oneOf": [ - { - "$ref": "#\/components\/schemas\/document" - }, - { - "$ref": "#\/components\/schemas\/documentList" - } - ] - } - } - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -5549,6 +5397,57 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthVersion" + } + } + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -9843,6 +9742,20 @@ "countryName" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 8b2a800291..b27f65f130 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -889,10 +889,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -2493,7 +2493,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2513,7 +2513,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2573,7 +2573,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2593,7 +2593,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2652,17 +2652,10 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { @@ -2672,7 +2665,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4745,7 +4738,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -5636,7 +5629,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5857,7 +5850,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -6078,7 +6071,7 @@ "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -6308,7 +6301,7 @@ "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -6548,7 +6541,7 @@ "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6791,7 +6784,7 @@ "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -7024,7 +7017,7 @@ "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -7389,7 +7382,7 @@ "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -7615,7 +7608,7 @@ "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7914,7 +7907,7 @@ "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -8100,151 +8093,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "tags": [ - "databases" - ], - "description": "Create 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.", - "responses": { - "201": { - "description": "Document, or Documents List", - "content": { - "application\/json": { - "schema": { - "oneOf": [ - { - "$ref": "#\/components\/schemas\/document" - }, - { - "$ref": "#\/components\/schemas\/documentList" - } - ] - } - } - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -9297,7 +9145,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9466,7 +9314,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10141,7 +9989,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10949,7 +10797,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11036,7 +10884,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11522,7 +11370,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -13458,6 +13306,57 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthVersion" + } + } + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -14696,7 +14595,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14716,7 +14615,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -18674,7 +18573,7 @@ "type": "", "deprecated": false, "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-deauthorize.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -18802,7 +18701,7 @@ "type": "", "deprecated": false, "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-projects.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19656,7 +19555,7 @@ "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23306,11 +23205,11 @@ "description": "", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/project" + "$ref": "#\/components\/schemas\/emailTemplate" } } } @@ -26666,7 +26565,7 @@ "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -37187,6 +37086,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 388b9bb30d..a772d5984f 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -866,10 +866,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -5140,7 +5140,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5363,7 +5363,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -5586,7 +5586,7 @@ "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -5818,7 +5818,7 @@ "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -6060,7 +6060,7 @@ "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6305,7 +6305,7 @@ "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -6540,7 +6540,7 @@ "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -6908,7 +6908,7 @@ "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -7136,7 +7136,7 @@ "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7438,7 +7438,7 @@ "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -7627,153 +7627,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "tags": [ - "databases" - ], - "description": "Create 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.", - "responses": { - "201": { - "description": "Document, or Documents List", - "content": { - "application\/json": { - "schema": { - "oneOf": [ - { - "$ref": "#\/components\/schemas\/document" - }, - { - "$ref": "#\/components\/schemas\/documentList" - } - ] - } - } - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [], - "Session": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "path" - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - } - } - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -9833,7 +9686,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9921,7 +9774,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12300,6 +12153,57 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthVersion" + } + } + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -13560,7 +13464,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13580,7 +13484,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26809,6 +26713,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index e736f20227..9c8da35b7c 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -367,7 +367,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -778,7 +780,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -922,14 +926,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -1806,7 +1815,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2490,7 +2501,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2611,7 +2624,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2627,7 +2640,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2697,7 +2710,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2713,7 +2726,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2776,7 +2789,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { "description": "No content" @@ -2789,7 +2802,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4697,151 +4710,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Create 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.", - "responses": { - "201": { - "description": "Document, or Documents List", - "schema": { - "x-oneOf": [ - { - "$ref": "#\/definitions\/document" - }, - { - "$ref": "#\/definitions\/documentList" - } - ] - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "default": [], - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - ] - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -5241,7 +5109,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5743,6 +5613,59 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "schema": { + "$ref": "#\/definitions\/healthVersion" + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -6709,7 +6632,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -7444,7 +7369,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -7872,7 +7799,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -10021,6 +9950,20 @@ "countryName" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index dcec505131..aba7d5c4b2 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -225,7 +225,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -421,7 +423,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -827,7 +831,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -970,14 +976,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -1841,7 +1852,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2522,7 +2535,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2641,7 +2656,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to update an existing push target for messages for the currently logged in user.", "responses": { "201": { "description": "Target", @@ -2657,7 +2672,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2726,7 +2741,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to create a new push target for messages for the currently logged in user.", "responses": { "200": { "description": "Target", @@ -2742,7 +2757,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2804,7 +2819,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to delete an existing push target for messages for the currently logged in user.", "responses": { "204": { "description": "No content" @@ -2817,7 +2832,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4948,7 +4963,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -5146,7 +5161,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5572,7 +5589,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5829,7 +5848,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6045,7 +6066,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6261,7 +6284,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6487,7 +6512,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6725,7 +6752,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6967,7 +6996,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7197,7 +7228,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7561,7 +7594,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7783,7 +7818,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7998,7 +8035,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8071,7 +8110,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8253,151 +8294,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Create 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.", - "responses": { - "201": { - "description": "Document, or Documents List", - "schema": { - "x-oneOf": [ - { - "$ref": "#\/definitions\/document" - }, - { - "$ref": "#\/definitions\/documentList" - } - ] - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "default": [], - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - ] - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -8797,7 +8693,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -9243,7 +9141,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -9420,7 +9320,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9584,7 +9484,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10280,7 +10180,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10641,7 +10541,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11013,7 +10915,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11079,7 +10983,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11096,7 +11002,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11180,7 +11086,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11580,7 +11486,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -11668,7 +11576,7 @@ "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12039,7 +11947,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -13654,6 +13564,59 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "schema": { + "$ref": "#\/definitions\/healthVersion" + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -14976,7 +14939,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14992,7 +14955,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19112,7 +19075,7 @@ "type": "", "deprecated": false, "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-deauthorize.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19246,7 +19209,7 @@ "type": "", "deprecated": false, "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-projects.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20018,7 +19981,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "migrations" ], @@ -20097,7 +20062,7 @@ "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20434,7 +20399,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "project" ], @@ -20908,7 +20875,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -22390,7 +22359,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -22952,7 +22923,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -23333,7 +23306,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -23779,9 +23754,9 @@ "description": "", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "schema": { - "$ref": "#\/definitions\/project" + "$ref": "#\/definitions\/emailTemplate" } } }, @@ -25314,7 +25289,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -25673,7 +25650,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "proxy" ], @@ -26208,7 +26187,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -26613,7 +26594,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -27127,7 +27110,7 @@ "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -27504,7 +27487,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -28006,7 +27991,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -28749,7 +28736,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -29484,7 +29473,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -30841,7 +30832,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -30899,7 +30892,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -32177,7 +32172,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "vcs" ], @@ -32395,7 +32392,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "vcs" ], @@ -37702,6 +37701,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index fc252c40ea..26d911ca12 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -385,7 +385,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -801,7 +803,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -946,14 +950,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -1843,7 +1852,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -2395,7 +2406,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], @@ -4629,7 +4642,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5060,7 +5075,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5320,7 +5337,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5538,7 +5557,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5756,7 +5777,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5984,7 +6007,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6224,7 +6249,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6468,7 +6495,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6700,7 +6729,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7067,7 +7098,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7291,7 +7324,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7508,7 +7543,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7582,7 +7619,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7767,153 +7806,6 @@ } ] }, - "post": { - "summary": "Create document", - "operationId": "databasesCreateDocument", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "databases" - ], - "description": "Create 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.", - "responses": { - "201": { - "description": "Document, or Documents List", - "schema": { - "x-oneOf": [ - { - "$ref": "#\/definitions\/document" - }, - { - "$ref": "#\/definitions\/documentList" - } - ] - } - } - }, - "x-appwrite": { - "method": "createDocument", - "weight": 108, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "databases\/create-document.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", - "rate-limit": 120, - "rate-time": 60, - "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", - "scope": "documents.write", - "platforms": [ - "client", - "server", - "server" - ], - "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", - "multiplex": { - "createDocument": { - "name": "Create Document", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "response": "document", - "description": "\/docs\/references\/databases\/create-document.md" - }, - "createDocuments": { - "name": "Create Documents", - "parameters": [ - "documents" - ], - "required": [ - "documents" - ], - "response": "documentList", - "description": "\/docs\/references\/databases\/create-documents.md" - } - }, - "auth": { - "Project": [], - "Session": [] - } - }, - "security": [ - { - "Project": [], - "Session": [], - "Key": [], - "JWT": [] - } - ], - "parameters": [ - { - "name": "databaseId", - "description": "Database ID.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "collectionId", - "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", - "required": true, - "type": "string", - "x-example": "", - "in": "path" - }, - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "documentId": { - "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", - "x-example": "" - }, - "data": { - "type": "object", - "description": "Document data as JSON object.", - "default": [], - "x-example": "{}" - }, - "documents": { - "type": "array", - "description": "Array of documents data as JSON object.", - "default": [], - "x-example": null, - "items": { - "type": "object" - } - }, - "permissions": { - "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, - "x-example": "[\"read(\"any\")\"]", - "items": { - "type": "string" - } - } - } - } - } - ] - }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", @@ -8321,7 +8213,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8682,7 +8576,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -9525,7 +9421,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -9902,7 +9800,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -9969,7 +9869,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -9986,7 +9888,7 @@ "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10071,7 +9973,7 @@ "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10479,7 +10381,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -10861,7 +10765,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], @@ -12504,6 +12410,59 @@ ] } }, + "\/health\/version": { + "get": { + "summary": "Get version", + "operationId": "healthGetVersion", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the version of Appwrite that this instance is currently running.", + "responses": { + "200": { + "description": "Health Version", + "schema": { + "$ref": "#\/definitions\/healthVersion" + } + } + }, + "x-appwrite": { + "method": "getVersion", + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-version.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "offline-model": "", + "offline-key": "", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, "\/locale": { "get": { "summary": "Get user locale", @@ -13848,7 +13807,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13864,7 +13823,7 @@ "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -18081,7 +18040,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -18495,7 +18456,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "storage" ], @@ -19246,7 +19209,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -19684,7 +19649,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "teams" ], @@ -20440,7 +20407,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -21108,7 +21077,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -22484,7 +22455,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -22543,7 +22516,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "users" ], @@ -27295,6 +27270,20 @@ "diff" ] }, + "healthVersion": { + "description": "Health Version", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of the Appwrite instance.", + "x-example": "0.11.0" + } + }, + "required": [ + "version" + ] + }, "headers": { "description": "Headers", "type": "object", diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 76a3ef8b61..1b8c3ac30e 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -21,6 +21,10 @@ use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\OpenSSL\OpenSSL; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; use Appwrite\Utopia\Database\Validator\CustomId; @@ -279,13 +283,15 @@ App::post('/v1/account') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/account/create.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'account', + name: 'create', + description: '/docs/references/account/create.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -416,15 +422,17 @@ App::get('/v1/account') ->desc('Get account') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/account/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'get', + description: '/docs/references/account/get.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + offlineModel: '/account', + offlineKey: 'current' + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -441,12 +449,15 @@ App::delete('/v1/account') ->label('scope', 'account') ->label('audits.event', 'user.delete') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/account/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'delete', + description: '/docs/references/account/delete.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->inject('user') ->inject('project') ->inject('response') @@ -486,14 +497,16 @@ App::get('/v1/account/sessions') ->desc('List sessions') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listSessions') - ->label('sdk.description', '/docs/references/account/list-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION_LIST) - ->label('sdk.offline.model', '/account/sessions') + ->label('sdk', new Method( + namespace: 'account', + name: 'listSessions', + description: '/docs/references/account/list-sessions.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION_LIST, + responseType: ResponseType::JSON, + offlineModel: '/account/sessions' + )) ->inject('response') ->inject('user') ->inject('locale') @@ -530,12 +543,15 @@ App::delete('/v1/account/sessions') ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteSessions') - ->label('sdk.description', '/docs/references/account/delete-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteSessions', + description: '/docs/references/account/delete-sessions.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 100) ->inject('request') ->inject('response') @@ -592,15 +608,17 @@ App::get('/v1/account/sessions/:sessionId') ->desc('Get session') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getSession') - ->label('sdk.description', '/docs/references/account/get-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) - ->label('sdk.offline.model', '/account/sessions') - ->label('sdk.offline.key', '{sessionId}') + ->label('sdk', new Method( + namespace: 'account', + name: 'getSession', + description: '/docs/references/account/get-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON, + offlineModel: '/account/sessions', + offlineKey: '{sessionId}' + )) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.') ->inject('response') ->inject('user') @@ -641,12 +659,15 @@ App::delete('/v1/account/sessions/:sessionId') ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteSession') - ->label('sdk.description', '/docs/references/account/delete-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteSession', + description: '/docs/references/account/delete-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 100) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.') ->inject('requestTimestamp') @@ -722,13 +743,15 @@ App::patch('/v1/account/sessions/:sessionId') ->label('audits.event', 'session.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateSession') - ->label('sdk.description', '/docs/references/account/update-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateSession', + description: '/docs/references/account/update-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to update the current device session.') ->inject('response') @@ -800,13 +823,15 @@ App::post('/v1/account/sessions/email') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createEmailPasswordSession') - ->label('sdk.description', '/docs/references/account/create-session-email-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createEmailPasswordSession', + description: '/docs/references/account/create-session-email-password.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', new Email(), 'User email.') @@ -934,13 +959,15 @@ App::post('/v1/account/sessions/anonymous') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createAnonymousSession') - ->label('sdk.description', '/docs/references/account/create-session-anonymous.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createAnonymousSession', + description: '/docs/references/account/create-session-anonymous.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->inject('request') @@ -1071,13 +1098,15 @@ App::post('/v1/account/sessions/token') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createSession', + description: '/docs/references/account/create-session.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -1098,14 +1127,17 @@ App::get('/v1/account/sessions/oauth2/:provider') ->groups(['api', 'account']) ->label('error', __DIR__ . '/../../views/general/error.phtml') ->label('scope', 'sessions.write') - ->label('sdk.auth', []) - ->label('sdk.hide', [APP_PLATFORM_SERVER]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createOAuth2Session') - ->label('sdk.description', '/docs/references/account/create-session-oauth2.md') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') + ->label('sdk', new Method( + namespace: 'account', + name: 'createOAuth2Session', + description: '/docs/references/account/create-session-oauth2.md', + methodType: MethodType::WEBAUTH, + auth: [], + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseType: ResponseType::HTML, + responseModel: Response::MODEL_NONE, + hide: [APP_PLATFORM_SERVER], + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') @@ -1688,13 +1720,16 @@ App::get('/v1/account/tokens/oauth2/:provider') ->groups(['api', 'account']) ->label('error', __DIR__ . '/../../views/general/error.phtml') ->label('scope', 'sessions.write') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createOAuth2Token') - ->label('sdk.description', '/docs/references/account/create-token-oauth2.md') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') + ->label('sdk', new Method( + namespace: 'account', + name: 'createOAuth2Token', + description: '/docs/references/account/create-token-oauth2.md', + auth: [], + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseType: ResponseType::HTML, + responseModel: Response::MODEL_NONE, + methodType: MethodType::WEBAUTH, + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') @@ -1761,13 +1796,15 @@ App::post('/v1/account/tokens/magic-url') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMagicURLToken') - ->label('sdk.description', '/docs/references/account/create-token-magic-url.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createMagicURLToken', + description: '/docs/references/account/create-token-magic-url.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2004,13 +2041,15 @@ App::post('/v1/account/tokens/email') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createEmailToken') - ->label('sdk.description', '/docs/references/account/create-token-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createEmailToken', + description: '/docs/references/account/create-token-email.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2233,14 +2272,16 @@ App::put('/v1/account/sessions/magic-url') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.deprecated', true) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMagicURLSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMagicURLSession', + description: '/docs/references/account/create-session.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SESSION, + deprecated: true, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2264,14 +2305,16 @@ App::put('/v1/account/sessions/phone') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.deprecated', true) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhoneSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhoneSession', + description: '/docs/references/account/create-session.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SESSION, + deprecated: true, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2296,13 +2339,15 @@ App::post('/v1/account/tokens/phone') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPhoneToken') - ->label('sdk.description', '/docs/references/account/create-token-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPhoneToken', + description: '/docs/references/account/create-token-phone.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2474,13 +2519,15 @@ App::post('/v1/account/jwts') ->groups(['api', 'account', 'auth']) ->label('scope', 'account') ->label('auth.type', 'jwt') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/account/create-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'account', + name: 'createJWT', + description: '/docs/references/account/create-jwt.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_JWT, + )) ->label('abuse-limit', 100) ->label('abuse-key', 'url:{url},userId:{userId}') ->inject('response') @@ -2516,15 +2563,17 @@ App::get('/v1/account/prefs') ->desc('Get account preferences') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/account/get-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/account/prefs') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'getPrefs', + description: '/docs/references/account/get-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PREFERENCES, + offlineModel: '/account/prefs', + offlineKey: 'current', + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -2538,13 +2587,15 @@ App::get('/v1/account/logs') ->desc('List logs') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/account/list-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'account', + name: 'listLogs', + description: '/docs/references/account/list-logs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST, + )) ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') ->inject('user') @@ -2606,15 +2657,17 @@ App::patch('/v1/account/name') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/account/update-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateName', + description: '/docs/references/account/update-name.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') ->inject('requestTimestamp') ->inject('response') @@ -2640,15 +2693,17 @@ App::patch('/v1/account/password') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePassword') - ->label('sdk.description', '/docs/references/account/update-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePassword', + description: '/docs/references/account/update-password.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->label('abuse-limit', 10) ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) ->param('oldPassword', '', new Password(), 'Current user password. Must be at least 8 chars.', true) @@ -2709,15 +2764,17 @@ App::patch('/v1/account/email') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/account/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateEmail', + description: '/docs/references/account/update-email.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') ->inject('requestTimestamp') @@ -2801,15 +2858,17 @@ App::patch('/v1/account/phone') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhone') - ->label('sdk.description', '/docs/references/account/update-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhone', + description: '/docs/references/account/update-phone.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') ->inject('requestTimestamp') @@ -2882,15 +2941,17 @@ App::patch('/v1/account/prefs') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/account/update-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account/prefs') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePrefs', + description: '/docs/references/account/update-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account/prefs', + offlineKey: 'current', + )) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') ->inject('requestTimestamp') ->inject('response') @@ -2915,13 +2976,15 @@ App::patch('/v1/account/status') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateStatus') - ->label('sdk.description', '/docs/references/account/update-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateStatus', + description: '/docs/references/account/update-status.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER + )) ->inject('requestTimestamp') ->inject('request') ->inject('response') @@ -2959,13 +3022,15 @@ App::post('/v1/account/recovery') ->label('audits.event', 'recovery.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createRecovery') - ->label('sdk.description', '/docs/references/account/create-recovery.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createRecovery', + description: '/docs/references/account/create-recovery.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('email', '', new Email(), 'User email.') @@ -3139,13 +3204,15 @@ App::put('/v1/account/recovery') ->label('audits.event', 'recovery.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateRecovery') - ->label('sdk.description', '/docs/references/account/update-recovery.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateRecovery', + description: '/docs/references/account/update-recovery.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3223,13 +3290,15 @@ App::post('/v1/account/verification') ->label('event', 'users.[userId].verification.[tokenId].create') ->label('audits.event', 'verification.create') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createVerification') - ->label('sdk.description', '/docs/references/account/create-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createVerification', + description: '/docs/references/account/create-email-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') ->param('url', '', fn ($clients) => new Host($clients), 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add built-in confirm page @@ -3388,13 +3457,15 @@ App::put('/v1/account/verification') ->label('event', 'users.[userId].verification.[tokenId].update') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateVerification') - ->label('sdk.description', '/docs/references/account/update-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateVerification', + description: '/docs/references/account/update-email-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3448,13 +3519,15 @@ App::post('/v1/account/verification/phone') ->label('event', 'users.[userId].verification.[tokenId].create') ->label('audits.event', 'verification.create') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPhoneVerification') - ->label('sdk.description', '/docs/references/account/create-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPhoneVerification', + description: '/docs/references/account/create-phone-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},userId:{userId}', 'url:{url},ip:{ip}']) ->inject('request') @@ -3575,13 +3648,15 @@ App::put('/v1/account/verification/phone') ->label('event', 'users.[userId].verification.[tokenId].update') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhoneVerification') - ->label('sdk.description', '/docs/references/account/update-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhoneVerification', + description: '/docs/references/account/update-phone-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOKEN, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3634,15 +3709,17 @@ App::patch('/v1/account/mfa') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMFA') - ->label('sdk.description', '/docs/references/account/update-mfa.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMFA', + description: '/docs/references/account/update-mfa.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current', + )) ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('requestTimestamp') ->inject('response') @@ -3683,15 +3760,17 @@ App::get('/v1/account/mfa/factors') ->desc('List factors') ->groups(['api', 'account', 'mfa']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listMfaFactors') - ->label('sdk.description', '/docs/references/account/list-mfa-factors.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_FACTORS) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'listMfaFactors', + description: '/docs/references/account/list-mfa-factors.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_FACTORS, + offlineKey: 'current', + offlineModel: '/account' + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -3719,15 +3798,17 @@ App::post('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/create-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_TYPE) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaAuthenticator', + description: '/docs/references/account/create-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_TYPE, + offlineModel: '/account', + offlineKey: 'current' + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') ->inject('response') @@ -3791,15 +3872,17 @@ App::put('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/update-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaAuthenticator', + description: '/docs/references/account/update-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USER, + offlineModel: '/account', + offlineKey: 'current' + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') ->inject('response') @@ -3856,15 +3939,17 @@ App::post('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/create-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaRecoveryCodes', + description: '/docs/references/account/create-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + offlineModel: '/account', + offlineKey: 'current', + )) ->inject('response') ->inject('user') ->inject('dbForProject') @@ -3898,15 +3983,17 @@ App::patch('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/update-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/account/update-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + offlineModel: '/account', + offlineKey: 'current', + )) ->inject('dbForProject') ->inject('response') ->inject('user') @@ -3935,15 +4022,17 @@ App::get('/v1/account/mfa/recovery-codes') ->desc('Get MFA recovery codes') ->groups(['api', 'account', 'mfaProtected']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/get-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'getMfaRecoveryCodes', + description: '/docs/references/account/get-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + offlineModel: '/account', + offlineKey: 'current', + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -3969,12 +4058,14 @@ App::delete('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/delete-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteMfaAuthenticator', + description: '/docs/references/account/delete-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') ->inject('user') @@ -4007,13 +4098,15 @@ App::post('/v1/account/mfa/challenge') ->label('audits.event', 'challenge.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaChallenge') - ->label('sdk.description', '/docs/references/account/create-mfa-challenge.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_CHALLENGE) + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaChallenge', + description: '/docs/references/account/create-mfa-challenge.md', + auth: [], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MFA_CHALLENGE, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') ->param('factor', '', new WhiteList([Type::EMAIL, Type::PHONE, Type::TOTP, Type::RECOVERY_CODE]), 'Factor used for verification. Must be one of following: `' . Type::EMAIL . '`, `' . Type::PHONE . '`, `' . Type::TOTP . '`, `' . Type::RECOVERY_CODE . '`.') @@ -4195,12 +4288,15 @@ App::put('/v1/account/mfa/challenge') ->label('audits.event', 'challenges.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaChallenge') - ->label('sdk.description', '/docs/references/account/update-mfa-challenge.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaChallenge', + description: '/docs/references/account/update-mfa-challenge.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SESSION, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') ->param('challengeId', '', new Text(256), 'ID of the challenge.') @@ -4281,12 +4377,15 @@ App::post('/v1/account/targets/push') ->label('audits.event', 'target.create') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].create') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPushTarget', + description: '/docs/references/account/create-push-target.md', + auth: [AuthType::SESSION], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TARGET, + )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') ->param('providerId', '', new UID(), 'Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.', true) @@ -4354,12 +4453,15 @@ App::put('/v1/account/targets/:targetId/push') ->label('audits.event', 'target.update') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].update') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePushTarget', + description: '/docs/references/account/update-push-target.md', + auth: [AuthType::SESSION], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TARGET, + )) ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') ->inject('queueForEvents') @@ -4411,12 +4513,14 @@ App::delete('/v1/account/targets/:targetId/push') ->label('audits.event', 'target.delete') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].delete') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deletePushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'deletePushTarget', + description: '/docs/references/account/delete-push-target.md', + auth: [AuthType::SESSION], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') ->inject('queueForDeletes') @@ -4454,14 +4558,16 @@ App::get('/v1/account/identities') ->desc('List identities') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listIdentities') - ->label('sdk.description', '/docs/references/account/list-identities.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_IDENTITY_LIST) - ->label('sdk.offline.model', '/account/identities') + ->label('sdk', new Method( + namespace: 'account', + name: 'listIdentities', + description: '/docs/references/account/list-identities.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_IDENTITY_LIST, + offlineModel: '/account/identities', + )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('user') @@ -4520,12 +4626,14 @@ App::delete('/v1/account/identities/:identityId') ->label('audits.event', 'identity.delete') ->label('audits.resource', 'identity/{request.$identityId}') ->label('audits.userId', '{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteIdentity') - ->label('sdk.description', '/docs/references/account/delete-identity.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteIdentity', + description: '/docs/references/account/delete-identity.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index dadd9da5e3..001ae09b94 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -1,6 +1,10 @@ label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/credit-card') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getCreditCard') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-credit-card.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getCreditCard', + description: '/docs/references/avatars/get-credit-card.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -184,13 +191,16 @@ App::get('/v1/avatars/browsers/:code') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/browser') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getBrowser') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-browser.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getBrowser', + description: '/docs/references/avatars/get-browser.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -204,13 +214,16 @@ App::get('/v1/avatars/flags/:code') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/flag') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getFlag') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-flag.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getFlag', + description: '/docs/references/avatars/get-flag.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -224,13 +237,16 @@ App::get('/v1/avatars/image') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/image') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getImage') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-image.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getImage', + description: '/docs/references/avatars/get-image.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE, + responseModel: Response::MODEL_NONE + )) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.', true) @@ -287,13 +303,16 @@ App::get('/v1/avatars/favicon') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/favicon') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getFavicon') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-favicon.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getFavicon', + description: '/docs/references/avatars/get-favicon.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE, + responseModel: Response::MODEL_NONE + )) ->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.') ->inject('response') ->action(function (string $url, Response $response) { @@ -430,13 +449,16 @@ App::get('/v1/avatars/qr') ->desc('Get QR code') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getQR') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-qr.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getQR', + description: '/docs/references/avatars/get-qr.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) ->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true) @@ -471,13 +493,16 @@ App::get('/v1/avatars/initials') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') ->label('cache.resource', 'avatar/initials') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getInitials') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-initials.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getInitials', + description: '/docs/references/avatars/get-initials.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + methodType: MethodType::LOCATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE_PNG, + responseModel: Response::MODEL_NONE + )) ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 500, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index eeb823a3d3..0ed74b8625 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -1,6 +1,9 @@ desc('Get variables') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'console') - ->label('sdk.method', 'variables') - ->label('sdk.description', '/docs/references/console/variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CONSOLE_VARIABLES) + ->label('sdk', new Method( + namespace: 'console', + name: 'variables', + description: '/docs/references/console/variables.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_CONSOLE_VARIABLES, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { $isDomainEnabled = !empty(System::getEnv('_APP_DOMAIN', '')) @@ -60,12 +65,15 @@ App::post('/v1/console/assistant') ->desc('Ask query') ->groups(['api', 'assistant']) ->label('scope', 'assistant.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'assistant') - ->label('sdk.method', 'chat') - ->label('sdk.description', '/docs/references/assistant/chat.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_TEXT) + ->label('sdk', new Method( + namespace: 'assistant', + name: 'chat', + description: '/docs/references/assistant/chat.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::TEXT + )) ->label('abuse-limit', 15) ->label('abuse-key', 'userId:{userId}') ->param('prompt', '', new Text(2000), 'Prompt. A string containing questions asked to the AI assistant.') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 4de4c4420e..cf5997619a 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -7,6 +7,9 @@ use Appwrite\Event\Event; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; use Appwrite\Utopia\Database\Validator\Queries\Collections; @@ -448,13 +451,15 @@ App::post('/v1/databases') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'database.create') ->label('audits.resource', 'database/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/databases/create.md') // create this file later - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) // Model for database needs to be created + ->label('sdk', new Method( + namespace: 'databases', + name: 'create', + description: '/docs/references/databases/create.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_DATABASE, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') ->param('enabled', true, new Boolean(), 'Is the database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) @@ -524,13 +529,15 @@ App::get('/v1/databases') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/databases/list.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'list', + description: '/docs/references/databases/list.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DATABASE_LIST, + responseType: ResponseType::JSON + )) ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -580,13 +587,15 @@ App::get('/v1/databases/:databaseId') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/databases/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'get', + description: '/docs/references/databases/get.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DATABASE, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') ->inject('dbForProject') @@ -606,13 +615,15 @@ App::get('/v1/databases/:databaseId/logs') ->groups(['api', 'database']) ->label('scope', 'databases.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/databases/get-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listLogs', + description: '/docs/references/databases/get-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -701,13 +712,15 @@ App::put('/v1/databases/:databaseId') ->label('event', 'databases.[databaseId].update') ->label('audits.event', 'database.update') ->label('audits.resource', 'database/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'update') - ->label('sdk.description', '/docs/references/databases/update.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'update', + description: '/docs/references/databases/update.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DATABASE, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') ->param('enabled', true, new Boolean(), 'Is database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) @@ -740,12 +753,14 @@ App::delete('/v1/databases/:databaseId') ->label('event', 'databases.[databaseId].delete') ->label('audits.event', 'database.delete') ->label('audits.resource', 'database/{request.databaseId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/databases/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'delete', + description: '/docs/references/databases/delete.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') ->inject('dbForProject') @@ -789,13 +804,15 @@ App::post('/v1/databases/:databaseId/collections') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'collection.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createCollection') - ->label('sdk.description', '/docs/references/databases/create-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createCollection', + description: '/docs/references/databases/create-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_COLLECTION, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.') @@ -854,13 +871,15 @@ App::get('/v1/databases/:databaseId/collections') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listCollections') - ->label('sdk.description', '/docs/references/databases/list-collections.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listCollections', + description: '/docs/references/databases/list-collections.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COLLECTION_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -920,13 +939,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getCollection') - ->label('sdk.description', '/docs/references/databases/get-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getCollection', + description: '/docs/references/databases/get-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COLLECTION, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') @@ -955,13 +976,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listCollectionLogs') - ->label('sdk.description', '/docs/references/databases/get-collection-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listCollectionLogs', + description: '/docs/references/databases/get-collection-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -1054,13 +1077,15 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') ->label('event', 'databases.[databaseId].collections.[collectionId].update') ->label('audits.event', 'collection.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateCollection') - ->label('sdk.description', '/docs/references/databases/update-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateCollection', + description: '/docs/references/databases/update-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COLLECTION, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.') @@ -1122,12 +1147,14 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') ->label('event', 'databases.[databaseId].collections.[collectionId].delete') ->label('audits.event', 'collection.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteCollection') - ->label('sdk.description', '/docs/references/databases/delete-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteCollection', + description: '/docs/references/databases/delete-collection.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') @@ -1178,13 +1205,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createStringAttribute') - ->label('sdk.description', '/docs/references/databases/create-string-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createStringAttribute', + description: '/docs/references/databases/create-string-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_STRING, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1235,13 +1264,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email' ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createEmailAttribute') - ->label('sdk.description', '/docs/references/databases/create-email-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createEmailAttribute', + description: '/docs/references/databases/create-email-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_EMAIL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1278,13 +1309,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createEnumAttribute') - ->label('sdk.description', '/docs/references/databases/create-attribute-enum.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createEnumAttribute', + description: '/docs/references/databases/create-attribute-enum.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_ENUM, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1326,13 +1359,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createIpAttribute') - ->label('sdk.description', '/docs/references/databases/create-ip-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIpAttribute', + description: '/docs/references/databases/create-ip-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_IP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1369,13 +1404,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createUrlAttribute') - ->label('sdk.description', '/docs/references/databases/create-url-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createUrlAttribute', + description: '/docs/references/databases/create-url-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_URL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1412,13 +1449,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createIntegerAttribute') - ->label('sdk.description', '/docs/references/databases/create-integer-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIntegerAttribute', + description: '/docs/references/databases/create-integer-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_INTEGER, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1484,13 +1523,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float' ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createFloatAttribute') - ->label('sdk.description', '/docs/references/databases/create-float-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createFloatAttribute', + description: '/docs/references/databases/create-float-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_FLOAT, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1554,13 +1595,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createBooleanAttribute') - ->label('sdk.description', '/docs/references/databases/create-boolean-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createBooleanAttribute', + description: '/docs/references/databases/create-boolean-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1596,13 +1639,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createDatetimeAttribute') - ->label('sdk.description', '/docs/references/databases/create-datetime-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_DATETIME) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createDatetimeAttribute', + description: '/docs/references/databases/create-datetime-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_DATETIME, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1641,13 +1686,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createRelationshipAttribute') - ->label('sdk.description', '/docs/references/databases/create-relationship-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_RELATIONSHIP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createRelationshipAttribute', + description: '/docs/references/databases/create-relationship-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('relatedCollectionId', '', new UID(), 'Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1767,13 +1814,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listAttributes') - ->label('sdk.description', '/docs/references/databases/list-attributes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listAttributes', + description: '/docs/references/databases/list-attributes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new Attributes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Attributes::ALLOWED_ATTRIBUTES), true) @@ -1848,23 +1897,26 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getAttribute') - ->label('sdk.description', '/docs/references/databases/get-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', [ - Response::MODEL_ATTRIBUTE_BOOLEAN, - Response::MODEL_ATTRIBUTE_INTEGER, - Response::MODEL_ATTRIBUTE_FLOAT, - Response::MODEL_ATTRIBUTE_EMAIL, - Response::MODEL_ATTRIBUTE_ENUM, - Response::MODEL_ATTRIBUTE_URL, - Response::MODEL_ATTRIBUTE_IP, - Response::MODEL_ATTRIBUTE_DATETIME, - Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Response::MODEL_ATTRIBUTE_STRING])// needs to be last, since its condition would dominate any other string attribute + ->label('sdk', new Method( + namespace: 'databases', + name: 'getAttribute', + description: '/docs/references/databases/get-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: [ + Response::MODEL_ATTRIBUTE_BOOLEAN, + Response::MODEL_ATTRIBUTE_INTEGER, + Response::MODEL_ATTRIBUTE_FLOAT, + Response::MODEL_ATTRIBUTE_EMAIL, + Response::MODEL_ATTRIBUTE_ENUM, + Response::MODEL_ATTRIBUTE_URL, + Response::MODEL_ATTRIBUTE_IP, + Response::MODEL_ATTRIBUTE_DATETIME, + Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_STRING + ], + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1926,12 +1978,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateStringAttribute') - ->label('sdk.description', '/docs/references/databases/update-string-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateStringAttribute', + description: '/docs/references/databases/update-string-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_STRING, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1970,12 +2025,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateEmailAttribute') - ->label('sdk.description', '/docs/references/databases/update-email-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateEmailAttribute', + description: '/docs/references/databases/update-email-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_EMAIL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2012,12 +2070,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/ ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateEnumAttribute') - ->label('sdk.description', '/docs/references/databases/update-enum-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateEnumAttribute', + description: '/docs/references/databases/update-enum-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_ENUM, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2056,12 +2117,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateIpAttribute') - ->label('sdk.description', '/docs/references/databases/update-ip-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateIpAttribute', + description: '/docs/references/databases/update-ip-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_IP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2098,12 +2162,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/: ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateUrlAttribute') - ->label('sdk.description', '/docs/references/databases/update-url-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateUrlAttribute', + description: '/docs/references/databases/update-url-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_URL, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2140,12 +2207,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateIntegerAttribute') - ->label('sdk.description', '/docs/references/databases/update-integer-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateIntegerAttribute', + description: '/docs/references/databases/update-integer-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_INTEGER, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2192,12 +2262,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateFloatAttribute') - ->label('sdk.description', '/docs/references/databases/update-float-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateFloatAttribute', + description: '/docs/references/databases/update-float-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_FLOAT, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2244,12 +2317,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateBooleanAttribute') - ->label('sdk.description', '/docs/references/databases/update-boolean-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateBooleanAttribute', + description: '/docs/references/databases/update-boolean-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2285,12 +2361,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDatetimeAttribute') - ->label('sdk.description', '/docs/references/databases/update-datetime-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_DATETIME) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDatetimeAttribute', + description: '/docs/references/databases/update-datetime-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_DATETIME, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2326,12 +2405,15 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateRelationshipAttribute') - ->label('sdk.description', '/docs/references/databases/update-relationship-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_RELATIONSHIP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateRelationshipAttribute', + description: '/docs/references/databases/update-relationship-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2384,12 +2466,14 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteAttribute') - ->label('sdk.description', '/docs/references/databases/delete-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteAttribute', + description: '/docs/references/databases/delete-attribute.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2498,13 +2582,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'index.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createIndex') - ->label('sdk.description', '/docs/references/databases/create-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIndex', + description: '/docs/references/databases/create-index.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_INDEX, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') @@ -2666,13 +2752,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listIndexes') - ->label('sdk.description', '/docs/references/databases/list-indexes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listIndexes', + description: '/docs/references/databases/list-indexes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_INDEX_LIST, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new Indexes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Indexes::ALLOWED_ATTRIBUTES), true) @@ -2742,13 +2830,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') ->groups(['api', 'database']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getIndex') - ->label('sdk.description', '/docs/references/databases/get-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getIndex', + description: '/docs/references/databases/get-index.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_INDEX, + responseType: ResponseType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') @@ -2785,12 +2875,14 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].update') ->label('audits.event', 'index.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteIndex') - ->label('sdk.description', '/docs/references/databases/delete-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteIndex', + description: '/docs/references/databases/delete-index.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Index Key.') @@ -2854,6 +2946,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'databases') + //TODO: Deal with SDK Multiplexing later - B/S ->label('sdk.method', [ 'createDocument' => [ 'name' => 'Create Document', @@ -3164,14 +3257,16 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listDocuments') - ->label('sdk.description', '/docs/references/databases/list-documents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') + ->label('sdk', new Method( + namespace: 'databases', + name: 'listDocuments', + description: '/docs/references/databases/list-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) @@ -3319,15 +3414,17 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getDocument') - ->label('sdk.description', '/docs/references/databases/get-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'getDocument', + description: '/docs/references/databases/get-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('documentId', '', new UID(), 'Document ID.') @@ -3412,13 +3509,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->groups(['api', 'database']) ->label('scope', 'documents.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listDocumentLogs') - ->label('sdk.description', '/docs/references/databases/get-document-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listDocumentLogs', + description: '/docs/references/databases/get-document-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('documentId', '', new UID(), 'Document ID.') @@ -3523,15 +3622,17 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDocument') - ->label('sdk.description', '/docs/references/databases/update-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDocument', + description: '/docs/references/databases/update-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('documentId', '', new UID(), 'Document ID.') @@ -3760,14 +3861,16 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDocuments') - ->label('sdk.description', '/docs/references/databases/update-documents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDocuments', + description: '/docs/references/databases/update-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.', true) @@ -3897,14 +4000,16 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteDocument') - ->label('sdk.description', '/docs/references/databases/delete-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteDocument', + description: '/docs/references/databases/delete-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('documentId', '', new UID(), 'Document ID.') @@ -4015,15 +4120,17 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteDocuments') - ->label('sdk.description', '/docs/references/databases/delete-documents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteDocuments', + description: '/docs/references/databases/delete-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DOCUMENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + offlineKey: '{documentId}' + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) @@ -4119,12 +4226,15 @@ App::get('/v1/databases/usage') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getUsage', + description: '/docs/references/databases/get-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_DATABASES, + responseType: ResponseType::JSON, + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') ->inject('dbForProject') @@ -4201,12 +4311,15 @@ App::get('/v1/databases/:databaseId/usage') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getDatabaseUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_DATABASE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getDatabaseUsage', + description: '/docs/references/databases/get-database-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_DATABASE, + responseType: ResponseType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') @@ -4289,12 +4402,15 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') ->label('resourceType', RESOURCE_TYPE_DATABASES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getCollectionUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getCollectionUsage', + description: '/docs/references/databases/get-collection-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_COLLECTION, + responseType: ResponseType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 2309defe5a..1d485538ee 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -14,6 +14,10 @@ use Appwrite\Functions\Validator\Headers; use Appwrite\Functions\Validator\RuntimeSpecification; use Appwrite\Messaging\Adapter\Realtime; use Appwrite\Platform\Tasks\ScheduleExecutions; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; @@ -141,13 +145,15 @@ App::post('/v1/functions') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'function.create') ->label('audits.resource', 'function/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/functions/create-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'create', + description: '/docs/references/functions/create-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new CustomId(), 'Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.') @@ -402,13 +408,15 @@ App::get('/v1/functions') ->desc('List functions') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/functions/list-functions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'list', + description: '/docs/references/functions/list-functions.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION_LIST, + responseType: ResponseType::JSON + )) ->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -463,13 +471,15 @@ App::get('/v1/functions/runtimes') ->desc('List runtimes') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listRuntimes') - ->label('sdk.description', '/docs/references/functions/list-runtimes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RUNTIME_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listRuntimes', + description: '/docs/references/functions/list-runtimes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_RUNTIME_LIST, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { $runtimes = Config::getParam('runtimes'); @@ -497,13 +507,15 @@ App::get('/v1/functions/specifications') ->desc('List available function runtime specifications') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listSpecifications') - ->label('sdk.description', '/docs/references/functions/list-specifications.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SPECIFICATION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listSpecifications', + description: '/docs/references/functions/list-specifications.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SPECIFICATION_LIST, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('plan') ->action(function (Response $response, array $plan) { @@ -534,13 +546,15 @@ App::get('/v1/functions/:functionId') ->desc('Get function') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/functions/get-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'get', + description: '/docs/references/functions/get-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') @@ -559,12 +573,15 @@ App::get('/v1/functions/:functionId/usage') ->groups(['api', 'functions', 'usage']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getFunctionUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getFunctionUsage', + description: '/docs/references/functions/get-function-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') @@ -664,12 +681,15 @@ App::get('/v1/functions/usage') ->groups(['api', 'functions']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getUsage', + description: '/docs/references/functions/get-functions-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_FUNCTIONS, + responseType: ResponseType::JSON + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') @@ -767,13 +787,15 @@ App::put('/v1/functions/:functionId') ->label('event', 'functions.[functionId].update') ->label('audits.event', 'function.update') ->label('audits.resource', 'function/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'update') - ->label('sdk.description', '/docs/references/functions/update-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'update', + description: '/docs/references/functions/update-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.', true) @@ -967,13 +989,16 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') ->desc('Download deployment') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getDeploymentDownload') - ->label('sdk.description', '/docs/references/functions/get-deployment-download.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'functions', + name: 'getDeploymentDownload', + description: '/docs/references/functions/get-deployment-download.md', + auth: [AuthType::KEY, AuthType::JWT], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::ANY, + methodType: MethodType::LOCATION + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1056,13 +1081,15 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId') ->label('event', 'functions.[functionId].deployments.[deploymentId].update') ->label('audits.event', 'deployment.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateDeployment') - ->label('sdk.description', '/docs/references/functions/update-function-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateDeployment', + description: '/docs/references/functions/update-function-deployment.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FUNCTION, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1119,12 +1146,14 @@ App::delete('/v1/functions/:functionId') ->label('event', 'functions.[functionId].delete') ->label('audits.event', 'function.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/functions/delete-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'delete', + description: '/docs/references/functions/delete-function.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') @@ -1167,16 +1196,18 @@ App::post('/v1/functions/:functionId/deployments') ->label('event', 'functions.[functionId].deployments.[deploymentId].create') ->label('audits.event', 'deployment.create') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createDeployment') - ->label('sdk.methodType', 'upload') - ->label('sdk.description', '/docs/references/functions/create-deployment.md') - ->label('sdk.packaging', true) - ->label('sdk.request.type', 'multipart/form-data') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createDeployment', + description: '/docs/references/functions/create-deployment.md', + auth: [AuthType::KEY], + requestType: 'multipart/form-data', + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_DEPLOYMENT, + responseType: ResponseType::JSON, + methodType: MethodType::UPLOAD, + packaging: true, + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('entrypoint', null, new Text(1028), 'Entrypoint File.', true) ->param('commands', null, new Text(8192, 0), 'Build Commands.', true) @@ -1384,13 +1415,15 @@ App::get('/v1/functions/:functionId/deployments') ->desc('List deployments') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listDeployments') - ->label('sdk.description', '/docs/references/functions/list-deployments.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listDeployments', + description: '/docs/references/functions/list-deployments.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DEPLOYMENT_LIST, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -1468,13 +1501,15 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId') ->desc('Get deployment') ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getDeployment') - ->label('sdk.description', '/docs/references/functions/get-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getDeployment', + description: '/docs/references/functions/get-deployment.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_DEPLOYMENT, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1515,12 +1550,14 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') ->label('event', 'functions.[functionId].deployments.[deploymentId].delete') ->label('audits.event', 'deployment.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteDeployment') - ->label('sdk.description', '/docs/references/functions/delete-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteDeployment', + description: '/docs/references/functions/delete-deployment.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1581,11 +1618,14 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/build') ->label('event', 'functions.[functionId].deployments.[deploymentId].update') ->label('audits.event', 'deployment.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createBuild') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createBuild', + description: '/docs/references/functions/create-deployment-build.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->param('buildId', '', new UID(), 'Build unique ID.', true) // added as optional param for backward compatibility @@ -1648,13 +1688,16 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build') ->label('scope', 'functions.write') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'deployment.update') - ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateDeploymentBuild') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUILD) + ->label('audits.resource', 'function/{request.functionId}') + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateDeploymentBuild', + description: '/docs/references/functions/update-deployment-build.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUILD, + responseType: ResponseType::JSON + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1738,15 +1781,16 @@ App::post('/v1/functions/:functionId/executions') ->label('scope', 'execution.write') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].executions.[executionId].create') - ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createExecution') - ->label('sdk.description', '/docs/references/functions/create-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_MULTIPART) - ->label('sdk.response.model', Response::MODEL_EXECUTION) - ->label('sdk.request.type', Response::CONTENT_TYPE_JSON) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createExecution', + description: '/docs/references/functions/create-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::MULTIPART, + responseModel: Response::MODEL_EXECUTION, + requestType: 'application/json', + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('body', '', new Text(10485760, 0), 'HTTP body of execution. Default value is empty string.', true) ->param('async', false, new Boolean(true), 'Execute code in the background. Default value is false.', true) @@ -2141,13 +2185,15 @@ App::get('/v1/functions/:functionId/executions') ->desc('List executions') ->label('scope', 'execution.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listExecutions') - ->label('sdk.description', '/docs/references/functions/list-executions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EXECUTION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listExecutions', + description: '/docs/references/functions/list-executions.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_EXECUTION_LIST + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2229,13 +2275,15 @@ App::get('/v1/functions/:functionId/executions/:executionId') ->desc('Get execution') ->label('scope', 'execution.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getExecution') - ->label('sdk.description', '/docs/references/functions/get-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EXECUTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getExecution', + description: '/docs/references/functions/get-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_EXECUTION + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') @@ -2280,12 +2328,14 @@ App::delete('/v1/functions/:functionId/executions/:executionId') ->label('event', 'functions.[functionId].executions.[executionId].delete') ->label('audits.event', 'executions.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteExecution') - ->label('sdk.description', '/docs/references/functions/delete-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteExecution', + description: '/docs/references/functions/delete-execution.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') @@ -2350,13 +2400,15 @@ App::post('/v1/functions/:functionId/variables') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.create') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createVariable') - ->label('sdk.description', '/docs/references/functions/create-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createVariable', + description: '/docs/references/functions/create-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) @@ -2412,14 +2464,17 @@ App::get('/v1/functions/:functionId/variables') ->desc('List variables') ->groups(['api', 'functions']) ->label('scope', 'functions.read') - ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listVariables') - ->label('sdk.description', '/docs/references/functions/list-variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE_LIST) + ->label('sdk', + new Method( + namespace: 'functions', + name: 'listVariables', + description: '/docs/references/functions/list-variables.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE_LIST + ) + ) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->inject('response') ->inject('dbForProject') @@ -2441,13 +2496,16 @@ App::get('/v1/functions/:functionId/variables/:variableId') ->groups(['api', 'functions']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getVariable') - ->label('sdk.description', '/docs/references/functions/get-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getVariable', + description: '/docs/references/functions/get-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE + ) + ) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') @@ -2483,13 +2541,15 @@ App::put('/v1/functions/:functionId/variables/:variableId') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateVariable') - ->label('sdk.description', '/docs/references/functions/update-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateVariable', + description: '/docs/references/functions/update-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_VARIABLE + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) @@ -2545,12 +2605,14 @@ App::delete('/v1/functions/:functionId/variables/:variableId') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteVariable') - ->label('sdk.description', '/docs/references/functions/delete-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteVariable', + description: '/docs/references/functions/delete-variable.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') @@ -2592,13 +2654,15 @@ App::get('/v1/functions/templates') ->desc('List function templates') ->label('scope', 'public') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listTemplates') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.description', '/docs/references/functions/list-templates.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION_LIST) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listTemplates', + description: '/docs/references/functions/list-templates.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TEMPLATE_FUNCTION_LIST + )) ->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true) ->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of use cases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' use cases are allowed.', true) ->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true) @@ -2630,13 +2694,15 @@ App::get('/v1/functions/templates/:templateId') ->desc('Get function template') ->label('scope', 'public') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getTemplate') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.description', '/docs/references/functions/get-template.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getTemplate', + description: '/docs/references/functions/get-template.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TEMPLATE_FUNCTION + )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') ->action(function (string $templateId, Response $response) { diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index f79f433b5c..6d34a8c70a 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -5,6 +5,10 @@ use Appwrite\Extend\Exception; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\GraphQL\Promises\Adapter; use Appwrite\GraphQL\Schema; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use GraphQL\Error\DebugFlag; @@ -38,13 +42,16 @@ App::get('/v1/graphql') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.hide', true) - ->label('sdk.description', '/docs/references/graphql/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'get', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + hide: true, + description: '/docs/references/graphql/get.md', + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_ANY + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->param('query', '', new Text(0, 0), 'The query to execute.') @@ -78,17 +85,19 @@ App::post('/v1/graphql/mutation') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.method', 'mutation') - ->label('sdk.methodType', 'graphql') - ->label('sdk.description', '/docs/references/graphql/post.md') - ->label('sdk.parameters', [ - 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], - ]) - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'mutation', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + description: '/docs/references/graphql/post.md', + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_ANY, + methodType: MethodType::GRAPHQL, + parameters: [ + 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], + ], + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->inject('request') @@ -123,17 +132,19 @@ App::post('/v1/graphql') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.method', 'query') - ->label('sdk.methodType', 'graphql') - ->label('sdk.description', '/docs/references/graphql/post.md') - ->label('sdk.parameters', [ - 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], - ]) - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'query', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + description: '/docs/references/graphql/post.md', + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_ANY, + methodType: MethodType::GRAPHQL, + parameters: [ + 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], + ], + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->inject('request') diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 60a8c0ca97..379afd34fc 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -3,6 +3,9 @@ use Appwrite\ClamAV\Network; use Appwrite\Event\Event; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; @@ -26,13 +29,15 @@ App::get('/v1/health') ->desc('Get HTTP') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/health/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + namespace: 'health', + name: 'get', + auth: [AuthType::KEY], + description: '/docs/references/health/get.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -49,9 +54,15 @@ App::get('/v1/health/version') ->desc('Get version') ->groups(['api', 'health']) ->label('scope', 'public') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_VERSION) + ->label('sdk', new Method( + namespace: 'health', + name: 'getVersion', + description: '/docs/references/health/get-version.md', + auth: [], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_VERSION, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { $response->dynamic(new Document([ 'version' => APP_VERSION_STABLE ]), Response::MODEL_HEALTH_VERSION); @@ -61,13 +72,15 @@ App::get('/v1/health/db') ->desc('Get DB') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getDB') - ->label('sdk.description', '/docs/references/health/get-db.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getDB', + description: '/docs/references/health/get-db.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -115,13 +128,15 @@ App::get('/v1/health/cache') ->desc('Get cache') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getCache') - ->label('sdk.description', '/docs/references/health/get-cache.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getCache', + description: '/docs/references/health/get-cache.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -173,13 +188,15 @@ App::get('/v1/health/queue') ->desc('Get queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueue') - ->label('sdk.description', '/docs/references/health/get-queue.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueue', + description: '/docs/references/health/get-queue.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -230,13 +247,15 @@ App::get('/v1/health/pubsub') ->desc('Get pubsub') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getPubSub') - ->label('sdk.description', '/docs/references/health/get-pubsub.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getPubSub', + description: '/docs/references/health/get-pubsub.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -288,13 +307,15 @@ App::get('/v1/health/time') ->desc('Get time') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getTime') - ->label('sdk.description', '/docs/references/health/get-time.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_TIME) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getTime', + description: '/docs/references/health/get-time.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_TIME, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -345,13 +366,15 @@ App::get('/v1/health/queue/webhooks') ->desc('Get webhooks queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueWebhooks') - ->label('sdk.description', '/docs/references/health/get-queue-webhooks.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueWebhooks', + description: '/docs/references/health/get-queue-webhooks.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -372,13 +395,15 @@ App::get('/v1/health/queue/logs') ->desc('Get logs queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueLogs') - ->label('sdk.description', '/docs/references/health/get-queue-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueLogs', + description: '/docs/references/health/get-queue-logs.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -399,13 +424,15 @@ App::get('/v1/health/certificate') ->desc('Get the SSL certificate for a domain') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getCertificate') - ->label('sdk.description', '/docs/references/health/get-certificate.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_CERTIFICATE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getCertificate', + description: '/docs/references/health/get-certificate.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_CERTIFICATE, + responseType: ResponseType::JSON + )) ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') ->inject('response') ->action(function (string $domain, Response $response) { @@ -449,13 +476,15 @@ App::get('/v1/health/queue/certificates') ->desc('Get certificates queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueCertificates') - ->label('sdk.description', '/docs/references/health/get-queue-certificates.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueCertificates', + description: '/docs/references/health/get-queue-certificates.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -476,13 +505,15 @@ App::get('/v1/health/queue/builds') ->desc('Get builds queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueBuilds') - ->label('sdk.description', '/docs/references/health/get-queue-builds.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueBuilds', + description: '/docs/references/health/get-queue-builds.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -503,13 +534,15 @@ App::get('/v1/health/queue/databases') ->desc('Get databases queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueDatabases') - ->label('sdk.description', '/docs/references/health/get-queue-databases.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueDatabases', + description: '/docs/references/health/get-queue-databases.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -531,13 +564,15 @@ App::get('/v1/health/queue/deletes') ->desc('Get deletes queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueDeletes') - ->label('sdk.description', '/docs/references/health/get-queue-deletes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueDeletes', + description: '/docs/references/health/get-queue-deletes.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -558,13 +593,15 @@ App::get('/v1/health/queue/mails') ->desc('Get mails queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMails') - ->label('sdk.description', '/docs/references/health/get-queue-mails.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMails', + description: '/docs/references/health/get-queue-mails.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -585,13 +622,15 @@ App::get('/v1/health/queue/messaging') ->desc('Get messaging queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMessaging') - ->label('sdk.description', '/docs/references/health/get-queue-messaging.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMessaging', + description: '/docs/references/health/get-queue-messaging.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -612,13 +651,15 @@ App::get('/v1/health/queue/migrations') ->desc('Get migrations queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMigrations') - ->label('sdk.description', '/docs/references/health/get-queue-migrations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMigrations', + description: '/docs/references/health/get-queue-migrations.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -639,13 +680,15 @@ App::get('/v1/health/queue/functions') ->desc('Get functions queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueFunctions') - ->label('sdk.description', '/docs/references/health/get-queue-functions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueFunctions', + description: '/docs/references/health/get-queue-functions.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -666,13 +709,15 @@ App::get('/v1/health/queue/usage') ->desc('Get usage queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueUsage') - ->label('sdk.description', '/docs/references/health/get-queue-usage.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueUsage', + description: '/docs/references/health/get-queue-usage.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -693,13 +738,15 @@ App::get('/v1/health/queue/usage-dump') ->desc('Get usage dump queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueUsageDump') - ->label('sdk.description', '/docs/references/health/get-queue-usage-dump.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueUsageDump', + description: '/docs/references/health/get-queue-usage-dump.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -720,13 +767,15 @@ App::get('/v1/health/storage/local') ->desc('Get local storage') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getStorageLocal') - ->label('sdk.description', '/docs/references/health/get-storage-local.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getStorageLocal', + description: '/docs/references/health/get-storage-local.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -763,13 +812,15 @@ App::get('/v1/health/storage') ->desc('Get storage') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getStorage') - ->label('sdk.description', '/docs/references/health/get-storage.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getStorage', + description: '/docs/references/health/get-storage.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_STATUS, + responseType: ResponseType::JSON + )) ->inject('response') ->inject('deviceForFiles') ->inject('deviceForFunctions') @@ -804,13 +855,15 @@ App::get('/v1/health/anti-virus') ->desc('Get antivirus') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getAntivirus') - ->label('sdk.description', '/docs/references/health/get-storage-anti-virus.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_ANTIVIRUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getAntivirus', + description: '/docs/references/health/get-storage-anti-virus.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_ANTIVIRUS, + responseType: ResponseType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -843,9 +896,15 @@ App::get('/v1/health/queue/failed/:name') ->desc('Get number of failed queue jobs') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getFailedJobs') + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getFailedJobs', + description: '/docs/references/health/get-failed-queue-jobs.md', + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_HEALTH_QUEUE, + responseType: ResponseType::JSON + )) ->param('name', '', new WhiteList([ Event::DATABASE_QUEUE_NAME, Event::DELETE_QUEUE_NAME, @@ -861,10 +920,6 @@ App::get('/v1/health/queue/failed/:name') Event::MIGRATIONS_QUEUE_NAME ]), 'The name of the queue') ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->label('sdk.description', '/docs/references/health/get-failed-queue-jobs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) ->inject('response') ->inject('queue') ->action(function (string $name, int|string $threshold, Response $response, Connection $queue) { diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 1f042d2239..c918d666a0 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -1,5 +1,8 @@ desc('Get user locale') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/locale/get-locale.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOCALE) - ->label('sdk.offline.model', '/localed') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'locale', + name: 'get', + description: '/docs/references/locale/get-locale.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOCALE, + responseType: ResponseType::JSON, + offlineKey: 'current', + offlineModel: '/localed', + )) ->inject('request') ->inject('response') ->inject('locale') @@ -72,15 +77,17 @@ App::get('/v1/locale/codes') ->desc('List locale codes') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCodes') - ->label('sdk.description', '/docs/references/locale/list-locale-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOCALE_CODE_LIST) - ->label('sdk.offline.model', '/locale/localeCode') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCodes', + description: '/docs/references/locale/list-locale-codes.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOCALE_CODE_LIST, + responseType: ResponseType::JSON, + offlineKey: 'current', + offlineModel: '/locale/localeCode', + )) ->inject('response') ->action(function (Response $response) { $codes = Config::getParam('locale-codes'); @@ -94,15 +101,17 @@ App::get('/v1/locale/countries') ->desc('List countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountries') - ->label('sdk.description', '/docs/references/locale/list-countries.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) - ->label('sdk.offline.model', '/locale/countries') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountries', + description: '/docs/references/locale/list-countries.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COUNTRY_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/countries', + offlineResponseKey: 'code' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -127,15 +136,17 @@ App::get('/v1/locale/countries/eu') ->desc('List EU countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountriesEU') - ->label('sdk.description', '/docs/references/locale/list-countries-eu.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) - ->label('sdk.offline.model', '/locale/countries/eu') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountriesEU', + description: '/docs/references/locale/list-countries-eu.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_COUNTRY_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/countries/eu', + offlineResponseKey: 'code' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -162,15 +173,17 @@ App::get('/v1/locale/countries/phones') ->desc('List countries phone codes') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountriesPhones') - ->label('sdk.description', '/docs/references/locale/list-countries-phones.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PHONE_LIST) - ->label('sdk.offline.model', '/locale/countries/phones') - ->label('sdk.offline.response.key', 'countryCode') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountriesPhones', + description: '/docs/references/locale/list-countries-phones.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PHONE_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/countries/phones', + offlineResponseKey: 'countryCode' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -196,15 +209,17 @@ App::get('/v1/locale/continents') ->desc('List continents') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listContinents') - ->label('sdk.description', '/docs/references/locale/list-continents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CONTINENT_LIST) - ->label('sdk.offline.model', '/locale/continents') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listContinents', + description: '/docs/references/locale/list-continents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_CONTINENT_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/continents', + offlineResponseKey: 'code' + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -228,15 +243,17 @@ App::get('/v1/locale/currencies') ->desc('List currencies') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCurrencies') - ->label('sdk.description', '/docs/references/locale/list-currencies.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CURRENCY_LIST) - ->label('sdk.offline.model', '/locale/currencies') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCurrencies', + description: '/docs/references/locale/list-currencies.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_CURRENCY_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/currencies', + offlineResponseKey: 'code' + )) ->inject('response') ->action(function (Response $response) { $list = Config::getParam('locale-currencies'); @@ -251,15 +268,17 @@ App::get('/v1/locale/languages') ->desc('List languages') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listLanguages') - ->label('sdk.description', '/docs/references/locale/list-languages.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LANGUAGE_LIST) - ->label('sdk.offline.model', '/locale/languages') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listLanguages', + description: '/docs/references/locale/list-languages.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LANGUAGE_LIST, + responseType: ResponseType::JSON, + offlineModel: '/locale/languages', + offlineResponseKey: 'code' + )) ->inject('response') ->action(function (Response $response) { $list = Config::getParam('locale-languages'); diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index e4a627d027..fbeb38e355 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -11,6 +11,9 @@ use Appwrite\Messaging\Status as MessageStatus; use Appwrite\Network\Validator\Email; use Appwrite\Permission; use Appwrite\Role; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -20,6 +23,7 @@ use Appwrite\Utopia\Database\Validator\Queries\Targets; use Appwrite\Utopia\Database\Validator\Queries\Topics; use Appwrite\Utopia\Response; use MaxMind\Db\Reader; +use Tests\Unit\Auth\AuthTest; use Utopia\App; use Utopia\Audit\Audit; use Utopia\Database\Database; @@ -57,13 +61,15 @@ App::post('/v1/messaging/providers/mailgun') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createMailgunProvider') - ->label('sdk.description', '/docs/references/messaging/create-mailgun-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createMailgunProvider', + description: '/docs/references/messaging/create-mailgun-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('apiKey', '', new Text(0), 'Mailgun API Key.', true) @@ -145,13 +151,15 @@ App::post('/v1/messaging/providers/sendgrid') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSendgridProvider') - ->label('sdk.description', '/docs/references/messaging/create-sendgrid-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSendgridProvider', + description: '/docs/references/messaging/create-sendgrid-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('apiKey', '', new Text(0), 'Sendgrid API key.', true) @@ -221,13 +229,15 @@ App::post('/v1/messaging/providers/smtp') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSmtpProvider') - ->label('sdk.description', '/docs/references/messaging/create-smtp-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSmtpProvider', + description: '/docs/references/messaging/create-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.') @@ -310,13 +320,15 @@ App::post('/v1/messaging/providers/msg91') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) ->label('event', 'providers.[providerId].create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createMsg91Provider') - ->label('sdk.description', '/docs/references/messaging/create-msg91-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createMsg91Provider', + description: '/docs/references/messaging/create-msg91-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('templateId', '', new Text(0), 'Msg91 template ID', true) @@ -387,13 +399,15 @@ App::post('/v1/messaging/providers/telesign') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTelesignProvider') - ->label('sdk.description', '/docs/references/messaging/create-telesign-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTelesignProvider', + description: '/docs/references/messaging/create-telesign-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -465,13 +479,15 @@ App::post('/v1/messaging/providers/textmagic') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTextmagicProvider') - ->label('sdk.description', '/docs/references/messaging/create-textmagic-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTextmagicProvider', + description: '/docs/references/messaging/create-textmagic-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -543,13 +559,15 @@ App::post('/v1/messaging/providers/twilio') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTwilioProvider') - ->label('sdk.description', '/docs/references/messaging/create-twilio-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTwilioProvider', + description: '/docs/references/messaging/create-twilio-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -621,13 +639,15 @@ App::post('/v1/messaging/providers/vonage') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createVonageProvider') - ->label('sdk.description', '/docs/references/messaging/create-vonage-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createVonageProvider', + description: '/docs/references/messaging/create-vonage-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -699,13 +719,15 @@ App::post('/v1/messaging/providers/fcm') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createFcmProvider') - ->label('sdk.description', '/docs/references/messaging/create-fcm-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createFcmProvider', + description: '/docs/references/messaging/create-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('serviceAccountJSON', null, new JSON(), 'FCM service account JSON.', true) @@ -763,13 +785,15 @@ App::post('/v1/messaging/providers/apns') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createApnsProvider') - ->label('sdk.description', '/docs/references/messaging/create-apns-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createApnsProvider', + description: '/docs/references/messaging/create-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('authKey', '', new Text(0), 'APNS authentication key.', true) @@ -847,13 +871,15 @@ App::get('/v1/messaging/providers') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listProviders') - ->label('sdk.description', '/docs/references/messaging/list-providers.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listProviders', + description: '/docs/references/messaging/list-providers.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER_LIST + )) ->param('queries', [], new Providers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -904,13 +930,15 @@ App::get('/v1/messaging/providers/:providerId/logs') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listProviderLogs') - ->label('sdk.description', '/docs/references/messaging/list-provider-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listProviderLogs', + description: '/docs/references/messaging/list-provider-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -993,13 +1021,15 @@ App::get('/v1/messaging/providers/:providerId') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getProvider') - ->label('sdk.description', '/docs/references/messaging/get-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getProvider', + description: '/docs/references/messaging/get-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('dbForProject') ->inject('response') @@ -1021,13 +1051,15 @@ App::patch('/v1/messaging/providers/mailgun/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateMailgunProvider') - ->label('sdk.description', '/docs/references/messaging/update-mailgun-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateMailgunProvider', + description: '/docs/references/messaging/update-mailgun-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('apiKey', '', new Text(0), 'Mailgun API Key.', true) @@ -1128,13 +1160,15 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSendgridProvider') - ->label('sdk.description', '/docs/references/messaging/update-sendgrid-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSendgridProvider', + description: '/docs/references/messaging/update-sendgrid-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1220,13 +1254,15 @@ App::patch('/v1/messaging/providers/smtp/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSmtpProvider') - ->label('sdk.description', '/docs/references/messaging/update-smtp-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSmtpProvider', + description: '/docs/references/messaging/update-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.', true) @@ -1343,13 +1379,15 @@ App::patch('/v1/messaging/providers/msg91/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateMsg91Provider') - ->label('sdk.description', '/docs/references/messaging/update-msg91-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateMsg91Provider', + description: '/docs/references/messaging/update-msg91-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1424,13 +1462,15 @@ App::patch('/v1/messaging/providers/telesign/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTelesignProvider') - ->label('sdk.description', '/docs/references/messaging/update-telesign-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTelesignProvider', + description: '/docs/references/messaging/update-telesign-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1507,13 +1547,15 @@ App::patch('/v1/messaging/providers/textmagic/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTextmagicProvider') - ->label('sdk.description', '/docs/references/messaging/update-textmagic-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTextmagicProvider', + description: '/docs/references/messaging/update-textmagic-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1590,13 +1632,15 @@ App::patch('/v1/messaging/providers/twilio/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTwilioProvider') - ->label('sdk.description', '/docs/references/messaging/update-twilio-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTwilioProvider', + description: '/docs/references/messaging/update-twilio-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1673,13 +1717,15 @@ App::patch('/v1/messaging/providers/vonage/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateVonageProvider') - ->label('sdk.description', '/docs/references/messaging/update-vonage-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateVonageProvider', + description: '/docs/references/messaging/update-vonage-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1756,13 +1802,15 @@ App::patch('/v1/messaging/providers/fcm/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateFcmProvider') - ->label('sdk.description', '/docs/references/messaging/update-fcm-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateFcmProvider', + description: '/docs/references/messaging/update-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1826,13 +1874,15 @@ App::patch('/v1/messaging/providers/apns/:providerId') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateApnsProvider') - ->label('sdk.description', '/docs/references/messaging/update-apns-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateApnsProvider', + description: '/docs/references/messaging/update-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_PROVIDER + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1922,13 +1972,15 @@ App::delete('/v1/messaging/providers/:providerId') ->label('event', 'providers.[providerId].delete') ->label('scope', 'providers.write') ->label('resourceType', RESOURCE_TYPE_PROVIDERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteProvider') - ->label('sdk.description', '/docs/references/messaging/delete-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteProvider', + description: '/docs/references/messaging/delete-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_NONE + )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') ->inject('dbForProject') @@ -1958,13 +2010,15 @@ App::post('/v1/messaging/topics') ->label('event', 'topics.[topicId].create') ->label('scope', 'topics.write') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTopic') - ->label('sdk.description', '/docs/references/messaging/create-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTopic', + description: '/docs/references/messaging/create-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC + )) ->param('topicId', '', new CustomId(), 'Topic ID. Choose a custom Topic ID or a new Topic ID.') ->param('name', '', new Text(128), 'Topic Name.') ->param('subscribe', [Role::users()], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) @@ -1999,13 +2053,15 @@ App::get('/v1/messaging/topics') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTopics') - ->label('sdk.description', '/docs/references/messaging/list-topics.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTopics', + description: '/docs/references/messaging/list-topics.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC_LIST + )) ->param('queries', [], new Topics(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Topics::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -2056,13 +2112,15 @@ App::get('/v1/messaging/topics/:topicId/logs') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTopicLogs') - ->label('sdk.description', '/docs/references/messaging/list-topic-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTopicLogs', + description: '/docs/references/messaging/list-topic-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2146,13 +2204,15 @@ App::get('/v1/messaging/topics/:topicId') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getTopic') - ->label('sdk.description', '/docs/references/messaging/get-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getTopic', + description: '/docs/references/messaging/get-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC + )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('dbForProject') ->inject('response') @@ -2175,13 +2235,15 @@ App::patch('/v1/messaging/topics/:topicId') ->label('event', 'topics.[topicId].update') ->label('scope', 'topics.write') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTopic') - ->label('sdk.description', '/docs/references/messaging/update-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTopic', + description: '/docs/references/messaging/update-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TOPIC + )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('name', null, new Text(128), 'Topic Name.', true) ->param('subscribe', null, new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) @@ -2220,13 +2282,15 @@ App::delete('/v1/messaging/topics/:topicId') ->label('event', 'topics.[topicId].delete') ->label('scope', 'topics.write') ->label('resourceType', RESOURCE_TYPE_TOPICS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteTopic') - ->label('sdk.description', '/docs/references/messaging/delete-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteTopic', + description: '/docs/references/messaging/delete-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_NONE + )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') ->inject('dbForProject') @@ -2261,13 +2325,15 @@ App::post('/v1/messaging/topics/:topicId/subscribers') ->label('event', 'topics.[topicId].subscribers.[subscriberId].create') ->label('scope', 'subscribers.write') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_JWT, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSubscriber') - ->label('sdk.description', '/docs/references/messaging/create-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSubscriber', + description: '/docs/references/messaging/create-subscriber.md', + auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SUBSCRIBER + )) ->param('subscriberId', '', new CustomId(), 'Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.') ->param('topicId', '', new UID(), 'Topic ID. The topic ID to subscribe to.') ->param('targetId', '', new UID(), 'Target ID. The target ID to link to the specified Topic ID.') @@ -2355,13 +2421,15 @@ App::get('/v1/messaging/topics/:topicId/subscribers') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listSubscribers') - ->label('sdk.description', '/docs/references/messaging/list-subscribers.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listSubscribers', + description: '/docs/references/messaging/list-subscribers.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SUBSCRIBER_LIST + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('queries', [], new Subscribers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2435,13 +2503,15 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listSubscriberLogs') - ->label('sdk.description', '/docs/references/messaging/list-subscriber-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listSubscriberLogs', + description: '/docs/references/messaging/list-subscriber-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2525,13 +2595,15 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getSubscriber') - ->label('sdk.description', '/docs/references/messaging/get-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getSubscriber', + description: '/docs/references/messaging/get-subscriber.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_SUBSCRIBER + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('dbForProject') @@ -2568,13 +2640,15 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->label('event', 'topics.[topicId].subscribers.[subscriberId].delete') ->label('scope', 'subscribers.write') ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) - ->label('sdk.auth', [APP_AUTH_TYPE_JWT, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteSubscriber') - ->label('sdk.description', '/docs/references/messaging/delete-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteSubscriber', + description: '/docs/references/messaging/delete-subscriber.md', + auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_NONE + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('queueForEvents') @@ -2628,13 +2702,15 @@ App::post('/v1/messaging/messages/email') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createEmail') - ->label('sdk.description', '/docs/references/messaging/create-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createEmail', + description: '/docs/references/messaging/create-email.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('subject', '', new Text(998), 'Email Subject.') ->param('content', '', new Text(64230), 'Email Content.') @@ -2781,13 +2857,15 @@ App::post('/v1/messaging/messages/sms') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSms') - ->label('sdk.description', '/docs/references/messaging/create-sms.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSms', + description: '/docs/references/messaging/create-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('content', '', new Text(64230), 'SMS Content.') ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -2898,13 +2976,15 @@ App::post('/v1/messaging/messages/push') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createPush') - ->label('sdk.description', '/docs/references/messaging/create-push.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createPush', + description: '/docs/references/messaging/create-push.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('title', '', new Text(256), 'Title for push notification.') ->param('body', '', new Text(64230), 'Body for push notification.') @@ -3072,13 +3152,15 @@ App::get('/v1/messaging/messages') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listMessages') - ->label('sdk.description', '/docs/references/messaging/list-messages.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listMessages', + description: '/docs/references/messaging/list-messages.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE_LIST + )) ->param('queries', [], new Messages(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Messages::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -3129,13 +3211,15 @@ App::get('/v1/messaging/messages/:messageId/logs') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listMessageLogs') - ->label('sdk.description', '/docs/references/messaging/list-message-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listMessageLogs', + description: '/docs/references/messaging/list-message-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_LOG_LIST + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -3219,13 +3303,15 @@ App::get('/v1/messaging/messages/:messageId/targets') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTargets') - ->label('sdk.description', '/docs/references/messaging/list-message-targets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET_LIST) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTargets', + description: '/docs/references/messaging/list-message-targets.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_TARGET_LIST + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Targets::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -3290,13 +3376,15 @@ App::get('/v1/messaging/messages/:messageId') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getMessage') - ->label('sdk.description', '/docs/references/messaging/get-message.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getMessage', + description: '/docs/references/messaging/get-message.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') ->inject('response') @@ -3318,13 +3406,15 @@ App::patch('/v1/messaging/messages/email/:messageId') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/messaging/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateEmail', + description: '/docs/references/messaging/update-email.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3519,13 +3609,15 @@ App::patch('/v1/messaging/messages/sms/:messageId') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSms') - ->label('sdk.description', '/docs/references/messaging/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSms', + description: '/docs/references/messaging/update-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3675,13 +3767,15 @@ App::patch('/v1/messaging/messages/push/:messageId') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updatePush') - ->label('sdk.description', '/docs/references/messaging/update-push.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updatePush', + description: '/docs/references/messaging/update-push.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_MESSAGE + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3914,13 +4008,14 @@ App::delete('/v1/messaging/messages/:messageId') ->label('event', 'messages.[messageId].delete') ->label('scope', 'messages.write') ->label('resourceType', RESOURCE_TYPE_MESSAGES) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/messaging/delete-message.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'delete', + description: '/docs/references/messaging/delete-message.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') ->inject('dbForConsole') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index bebb6ebaea..1fb18e1e15 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -6,6 +6,10 @@ use Appwrite\Event\Migration; use Appwrite\Extend\Exception; use Appwrite\Permission; use Appwrite\Role; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -38,13 +42,15 @@ App::post('/v1/migrations/appwrite') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createAppwriteMigration') - ->label('sdk.description', '/docs/references/migrations/migration-appwrite.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createAppwriteMigration', + description: '/docs/references/migrations/migration-appwrite.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") ->param('projectId', '', new UID(), "Source's Project ID") @@ -93,13 +99,15 @@ App::post('/v1/migrations/firebase/oauth') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseOAuthMigration') - ->label('sdk.description', '/docs/references/migrations/migration-firebase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createFirebaseOAuthMigration', + description: '/docs/references/migrations/migration-firebase.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID of the Firebase Project') ->inject('response') @@ -196,13 +204,15 @@ App::post('/v1/migrations/firebase') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseMigration') - ->label('sdk.description', '/docs/references/migrations/migration-firebase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createFirebaseMigration', + description: '/docs/references/migrations/migration-firebase.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') ->inject('response') @@ -257,13 +267,15 @@ App::post('/v1/migrations/supabase') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createSupabaseMigration') - ->label('sdk.description', '/docs/references/migrations/migration-supabase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createSupabaseMigration', + description: '/docs/references/migrations/migration-supabase.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint') ->param('apiKey', '', new Text(512), 'Source\'s API Key') @@ -318,13 +330,15 @@ App::post('/v1/migrations/nhost') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createNHostMigration') - ->label('sdk.description', '/docs/references/migrations/migration-nhost.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createNHostMigration', + description: '/docs/references/migrations/migration-nhost.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain') ->param('region', '', new Text(512), 'Source\'s Region') @@ -379,13 +393,15 @@ App::get('/v1/migrations') ->groups(['api', 'migrations']) ->desc('List migrations') ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/migrations/list-migrations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_LIST) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'list', + description: '/docs/references/migrations/list-migrations.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_LIST, + responseType: ResponseType::JSON + )) ->param('queries', [], new Migrations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Migrations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -438,13 +454,15 @@ App::get('/v1/migrations/:migrationId') ->groups(['api', 'migrations']) ->desc('Get migration') ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/migrations/get-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'get', + description: '/docs/references/migrations/get-migration.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') ->inject('dbForProject') @@ -462,13 +480,15 @@ App::get('/v1/migrations/appwrite/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Appwrite data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getAppwriteReport') - ->label('sdk.description', '/docs/references/migrations/migration-appwrite-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getAppwriteReport', + description: '/docs/references/migrations/migration-appwrite-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") ->param('projectID', '', new Text(512), "Source's Project ID") @@ -504,13 +524,15 @@ App::get('/v1/migrations/firebase/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Firebase data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getFirebaseReport') - ->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getFirebaseReport', + description: '/docs/references/migrations/migration-firebase-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') ->inject('response') @@ -551,13 +573,15 @@ App::get('/v1/migrations/firebase/report/oauth') ->groups(['api', 'migrations']) ->desc('Generate a report on Firebase data using OAuth') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getFirebaseReportOAuth') - ->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getFirebaseReportOAuth', + description: '/docs/references/migrations/migration-firebase-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID') ->inject('response') @@ -642,14 +666,17 @@ App::get('/v1/migrations/firebase/connect') ->desc('Authorize with Firebase') ->groups(['api', 'migrations']) ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseAuth') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') - ->label('sdk.hide', true) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createFirebaseAuth', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::HTML, + hide: true, + methodType: MethodType::WEBAUTH + )) ->param('redirect', '', fn ($clients) => new Host($clients), 'URL to redirect back to your Firebase authorization. Only console hostnames are allowed.', true, ['clients']) ->param('projectId', '', new UID(), 'Project ID') ->inject('response') @@ -796,13 +823,15 @@ App::get('/v1/migrations/firebase/projects') ->desc('List Firebase projects') ->groups(['api', 'migrations']) ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'listFirebaseProjects') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'listFirebaseProjects', + description: '/docs/references/migrations/migration-firebase-projects.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST, + responseType: ResponseType::JSON + )) ->inject('user') ->inject('response') ->inject('project') @@ -885,12 +914,15 @@ App::get('/v1/migrations/firebase/deauthorize') ->desc('Revoke Appwrite\'s authorization to access Firebase projects') ->groups(['api', 'migrations']) ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'deleteFirebaseAuth') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'deleteFirebaseAuth', + description: '/docs/references/migrations/migration-firebase-deauthorize.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->inject('user') ->inject('response') ->inject('dbForConsole') @@ -913,13 +945,15 @@ App::get('/v1/migrations/supabase/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Supabase Data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getSupabaseReport') - ->label('sdk.description', '/docs/references/migrations/migration-supabase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getSupabaseReport', + description: '/docs/references/migrations/migration-supabase-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint.') ->param('apiKey', '', new Text(512), 'Source\'s API Key.') @@ -956,13 +990,15 @@ App::get('/v1/migrations/nhost/report') ->groups(['api', 'migrations']) ->desc('Generate a report on NHost Data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getNHostReport') - ->label('sdk.description', '/docs/references/migrations/migration-nhost-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getNHostReport', + description: '/docs/references/migrations/migration-nhost-report.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MIGRATION_REPORT, + responseType: ResponseType::JSON + )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate.') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain.') ->param('region', '', new Text(512), 'Source\'s Region.') @@ -1002,13 +1038,15 @@ App::patch('/v1/migrations/:migrationId') ->label('event', 'migrations.[migrationId].retry') ->label('audits.event', 'migration.retry') ->label('audits.resource', 'migrations/{request.migrationId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'retry') - ->label('sdk.description', '/docs/references/migrations/retry-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'retry', + description: '/docs/references/migrations/retry-migration.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_ACCEPTED, + responseModel: Response::MODEL_MIGRATION, + responseType: ResponseType::JSON + )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') ->inject('dbForProject') @@ -1047,12 +1085,15 @@ App::delete('/v1/migrations/:migrationId') ->label('event', 'migrations.[migrationId].delete') ->label('audits.event', 'migrationId.delete') ->label('audits.resource', 'migrations/{request.migrationId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/migrations/delete-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'delete', + description: '/docs/references/migrations/delete-migration.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON + )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 6053326308..1685a04152 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -1,6 +1,9 @@ desc('Get project usage stats') ->groups(['api', 'usage']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_PROJECT) + ->label('sdk', new Method( + namespace: 'project', + name: 'getUsage', + description: '/docs/references/project/get-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_PROJECT, + responseType: ResponseType::JSON, + )) ->param('startDate', '', new DateTimeValidator(), 'Starting date for the usage') ->param('endDate', '', new DateTimeValidator(), 'End date for the usage') ->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true) @@ -313,13 +319,15 @@ App::post('/v1/project/variables') ->groups(['api']) ->label('scope', 'projects.write') ->label('audits.event', 'variable.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'createVariable') - ->label('sdk.description', '/docs/references/project/create-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'createVariable', + description: '/docs/references/project/create-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_VARIABLE, + responseType: ResponseType::JSON, + )) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) ->inject('project') @@ -367,13 +375,15 @@ App::get('/v1/project/variables') ->desc('List variables') ->groups(['api']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'listVariables') - ->label('sdk.description', '/docs/references/project/list-variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE_LIST) + ->label('sdk', new Method( + namespace: 'project', + name: 'listVariables', + description: '/docs/references/project/list-variables.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_VARIABLE_LIST, + responseType: ResponseType::JSON, + )) ->inject('response') ->inject('dbForProject') ->action(function (Response $response, Database $dbForProject) { @@ -392,13 +402,15 @@ App::get('/v1/project/variables/:variableId') ->desc('Get variable') ->groups(['api']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'getVariable') - ->label('sdk.description', '/docs/references/project/get-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'getVariable', + description: '/docs/references/project/get-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_VARIABLE, + responseType: ResponseType::JSON, + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('project') @@ -416,13 +428,15 @@ App::put('/v1/project/variables/:variableId') ->desc('Update variable') ->groups(['api']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'updateVariable') - ->label('sdk.description', '/docs/references/project/update-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'updateVariable', + description: '/docs/references/project/update-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_VARIABLE, + responseType: ResponseType::JSON, + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', true) @@ -462,12 +476,14 @@ App::delete('/v1/project/variables/:variableId') ->desc('Delete variable') ->groups(['api']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'deleteVariable') - ->label('sdk.description', '/docs/references/project/delete-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'project', + name: 'deleteVariable', + description: '/docs/references/project/delete-variable.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') ->inject('response') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index df8b1cb07b..901b94f579 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -10,6 +10,9 @@ use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -62,12 +65,15 @@ App::post('/v1/projects') ->groups(['api', 'projects']) ->label('audits.event', 'projects.create') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'create') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'create', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new ProjectId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('teamId', '', new UID(), 'Team unique ID.') @@ -252,12 +258,15 @@ App::get('/v1/projects') ->desc('List projects') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'list') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'list', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -311,12 +320,15 @@ App::get('/v1/projects/:projectId') ->desc('Get project') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'get') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'get', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -335,12 +347,15 @@ App::patch('/v1/projects/:projectId') ->desc('Update project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'update') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'update', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) @@ -382,12 +397,15 @@ App::patch('/v1/projects/:projectId/team') ->desc('Update project team') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateTeam') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateTeam', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('teamId', '', new UID(), 'Team ID of the team to transfer project to.') ->inject('response') @@ -450,12 +468,15 @@ App::patch('/v1/projects/:projectId/service') ->desc('Update service status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateServiceStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateServiceStatus', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])), true), 'Service name.') ->param('status', null, new Boolean(), 'Service status.') @@ -481,12 +502,15 @@ App::patch('/v1/projects/:projectId/service/all') ->desc('Update all service status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateServiceStatusAll') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateServiceStatusAll', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'Service status.') ->inject('response') @@ -515,12 +539,15 @@ App::patch('/v1/projects/:projectId/api') ->desc('Update API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateApiStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateApiStatus', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('api', '', new WhiteList(array_keys(Config::getParam('apis')), true), 'API name.') ->param('status', null, new Boolean(), 'API status.') @@ -546,12 +573,15 @@ App::patch('/v1/projects/:projectId/api/all') ->desc('Update all API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateApiStatusAll') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateApiStatusAll', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'API status.') ->inject('response') @@ -580,12 +610,15 @@ App::patch('/v1/projects/:projectId/oauth2') ->desc('Update project OAuth2') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateOAuth2') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateOAuth2', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'Provider Name') ->param('appId', null, new Text(256), 'Provider app ID. Max length: 256 chars.', true) @@ -624,12 +657,15 @@ App::patch('/v1/projects/:projectId/auth/session-alerts') ->desc('Update project sessions emails') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSessionAlerts') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSessionAlerts', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('alerts', false, new Boolean(true), 'Set to true to enable session emails.') ->inject('response') @@ -655,12 +691,15 @@ App::patch('/v1/projects/:projectId/auth/memberships-privacy') ->desc('Update project memberships privacy attributes') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateMembershipsPrivacy') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateMembershipsPrivacy', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('userName', true, new Boolean(true), 'Set to true to show userName to members of a team.') ->param('userEmail', true, new Boolean(true), 'Set to true to show email to members of a team.') @@ -690,12 +729,15 @@ App::patch('/v1/projects/:projectId/auth/limit') ->desc('Update project users limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthLimit') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthLimit', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(0, APP_LIMIT_USERS), 'Set the max number of users allowed in this project. Use 0 for unlimited.') ->inject('response') @@ -721,12 +763,15 @@ App::patch('/v1/projects/:projectId/auth/duration') ->desc('Update project authentication duration') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthDuration') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthDuration', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('duration', 31536000, new Range(0, 31536000), 'Project session length in seconds. Max length: 31536000 seconds.') ->inject('response') @@ -752,12 +797,15 @@ App::patch('/v1/projects/:projectId/auth/:method') ->desc('Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthStatus', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('method', '', new WhiteList(\array_keys(Config::getParam('auth')), true), 'Auth Method. Possible values: ' . implode(',', \array_keys(Config::getParam('auth'))), false) ->param('status', false, new Boolean(true), 'Set the status of this auth method.') @@ -786,12 +834,15 @@ App::patch('/v1/projects/:projectId/auth/password-history') ->desc('Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthPasswordHistory') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthPasswordHistory', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', 0, new Range(0, APP_LIMIT_USER_PASSWORD_HISTORY), 'Set the max number of passwords to store in user history. User can\'t choose a new password that is already stored in the password history list. Max number of passwords allowed in history is' . APP_LIMIT_USER_PASSWORD_HISTORY . '. Default value is 0') ->inject('response') @@ -817,12 +868,15 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary') ->desc('Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthPasswordDictionary') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthPasswordDictionary', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to enable checking user\'s password against most commonly used passwords. Default is false.') ->inject('response') @@ -848,12 +902,15 @@ App::patch('/v1/projects/:projectId/auth/personal-data') ->desc('Enable or disable checking user passwords for similarity with their personal data.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updatePersonalDataCheck') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updatePersonalDataCheck', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to check a password for similarity with personal data. Default is false.') ->inject('response') @@ -879,12 +936,15 @@ App::patch('/v1/projects/:projectId/auth/max-sessions') ->desc('Update project user sessions limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthSessionsLimit') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthSessionsLimit', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(1, APP_LIMIT_USER_SESSIONS_MAX), 'Set the max number of users allowed in this project. Value allowed is between 1-' . APP_LIMIT_USER_SESSIONS_MAX . '. Default is ' . APP_LIMIT_USER_SESSIONS_DEFAULT) ->inject('response') @@ -910,12 +970,15 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers') ->desc('Update the mock numbers for the project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateMockNumbers') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateMockNumbers', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('numbers', '', new ArrayList(new MockNumber(), 10), 'An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.') ->inject('response') @@ -950,11 +1013,15 @@ App::delete('/v1/projects/:projectId') ->groups(['api', 'projects']) ->label('audits.event', 'projects.delete') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'delete') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'delete', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('user') @@ -985,12 +1052,15 @@ App::post('/v1/projects/:projectId/webhooks') ->desc('Create webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') ->param('enabled', true, new Boolean(true), 'Enable or disable a webhook.', true) @@ -1043,12 +1113,15 @@ App::get('/v1/projects/:projectId/webhooks') ->desc('List webhooks') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listWebhooks') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listWebhooks', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK_LIST, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -1075,12 +1148,15 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Get webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') @@ -1109,12 +1185,15 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Update webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') @@ -1168,12 +1247,15 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') ->desc('Update webhook signature key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateWebhookSignature') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateWebhookSignature', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_WEBHOOK, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') @@ -1207,11 +1289,15 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Delete webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteWebhook', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') @@ -1246,12 +1332,15 @@ App::post('/v1/projects/:projectId/keys') ->desc('Create key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createKey') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_KEY, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') @@ -1296,12 +1385,15 @@ App::get('/v1/projects/:projectId/keys') ->desc('List keys') ->groups(['api', 'projects']) ->label('scope', 'keys.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listKeys') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listKeys', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_KEY_LIST, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -1328,12 +1420,15 @@ App::get('/v1/projects/:projectId/keys/:keyId') ->desc('Get key') ->groups(['api', 'projects']) ->label('scope', 'keys.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_KEY, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') @@ -1362,12 +1457,15 @@ App::put('/v1/projects/:projectId/keys/:keyId') ->desc('Update key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_KEY, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') @@ -1408,11 +1506,15 @@ App::delete('/v1/projects/:projectId/keys/:keyId') ->desc('Delete key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteKey') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteKey', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') @@ -1447,12 +1549,15 @@ App::post('/v1/projects/:projectId/jwts') ->groups(['api', 'projects']) ->desc('Create JWT') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createJWT') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createJWT', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_JWT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for JWT key. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') ->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true) @@ -1483,12 +1588,15 @@ App::post('/v1/projects/:projectId/platforms') ->groups(['api', 'projects']) ->label('audits.event', 'platforms.create') ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createPlatform') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createPlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_PLATFORM, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') @@ -1533,12 +1641,15 @@ App::get('/v1/projects/:projectId/platforms') ->desc('List platforms') ->groups(['api', 'projects']) ->label('scope', 'platforms.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listPlatforms') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listPlatforms', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PLATFORM_LIST, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -1565,12 +1676,15 @@ App::get('/v1/projects/:projectId/platforms/:platformId') ->desc('Get platform') ->groups(['api', 'projects']) ->label('scope', 'platforms.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getPlatform') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getPlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PLATFORM, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->inject('response') @@ -1599,12 +1713,15 @@ App::put('/v1/projects/:projectId/platforms/:platformId') ->desc('Update platform') ->groups(['api', 'projects']) ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updatePlatform') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updatePlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PLATFORM, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') @@ -1647,11 +1764,15 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') ->groups(['api', 'projects']) ->label('audits.event', 'platforms.delete') ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deletePlatform') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deletePlatform', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->inject('response') @@ -1686,12 +1807,15 @@ App::patch('/v1/projects/:projectId/smtp') ->desc('Update SMTP') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSmtp') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSmtp', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROJECT, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) @@ -1776,11 +1900,15 @@ App::post('/v1/projects/:projectId/smtp/tests') ->desc('Create SMTP test') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createSmtpTest') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createSmtpTest', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.') ->param('senderName', System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'), new Text(255, 0), 'Name of the email sender') @@ -1835,12 +1963,15 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Get custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getSmsTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SMS_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -1876,12 +2007,15 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Get custom email template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getEmailTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_EMAIL_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -1928,12 +2062,15 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Update custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSmsTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SMS_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -1968,12 +2105,15 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Update custom email templates') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateEmailTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_EMAIL_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -2018,12 +2158,15 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Reset custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteSmsTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SMS_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -2061,12 +2204,15 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Reset custom email template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteEmailTemplate', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_EMAIL_TEMPLATE, + responseType: ResponseType::JSON, + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 56fd31e88c..8818de0d54 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -5,6 +5,9 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\CNAME; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -28,13 +31,15 @@ App::post('/v1/proxy/rules') ->label('event', 'rules.[ruleId].create') ->label('audits.event', 'rule.create') ->label('audits.resource', 'rule/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'createRule') - ->label('sdk.description', '/docs/references/proxy/create-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'createRule', + description: '/docs/references/proxy/create-rule.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_PROXY_RULE, + responseType: ResponseType::JSON, + )) ->param('domain', null, new ValidatorDomain(), 'Domain name.') ->param('resourceType', null, new WhiteList(['api', 'function']), 'Action definition for the rule. Possible values are "api", "function"') ->param('resourceId', '', new UID(), 'ID of resource for the action type. If resourceType is "api", leave empty. If resourceType is "function", provide ID of the function.', true) @@ -150,13 +155,15 @@ App::get('/v1/proxy/rules') ->groups(['api', 'proxy']) ->desc('List rules') ->label('scope', 'rules.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'listRules') - ->label('sdk.description', '/docs/references/proxy/list-rules.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE_LIST) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'listRules', + description: '/docs/references/proxy/list-rules.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROXY_RULE_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -219,13 +226,15 @@ App::get('/v1/proxy/rules/:ruleId') ->groups(['api', 'proxy']) ->desc('Get rule') ->label('scope', 'rules.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'getRule') - ->label('sdk.description', '/docs/references/proxy/get-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'getRule', + description: '/docs/references/proxy/get-rule.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROXY_RULE, + responseType: ResponseType::JSON, + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('project') @@ -251,12 +260,14 @@ App::delete('/v1/proxy/rules/:ruleId') ->label('event', 'rules.[ruleId].delete') ->label('audits.event', 'rules.delete') ->label('audits.resource', 'rule/{request.ruleId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'deleteRule') - ->label('sdk.description', '/docs/references/proxy/delete-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'deleteRule', + description: '/docs/references/proxy/delete-rule.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('project') @@ -288,12 +299,15 @@ App::patch('/v1/proxy/rules/:ruleId/verification') ->label('event', 'rules.[ruleId].update') ->label('audits.event', 'rule.update') ->label('audits.resource', 'rule/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'updateRuleVerification') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'updateRuleVerification', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PROXY_RULE, + responseType: ResponseType::JSON, + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('queueForCertificates') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index dda39a0db0..fe4bba7640 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -8,6 +8,10 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\OpenSSL\OpenSSL; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; @@ -54,13 +58,15 @@ App::post('/v1/storage/buckets') ->label('event', 'buckets.[bucketId].create') ->label('audits.event', 'bucket.create') ->label('audits.resource', 'bucket/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'createBucket') - ->label('sdk.description', '/docs/references/storage/create-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'createBucket', + description: '/docs/references/storage/create-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_BUCKET, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Bucket name') ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) @@ -150,13 +156,15 @@ App::get('/v1/storage/buckets') ->groups(['api', 'storage']) ->label('scope', 'buckets.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'listBuckets') - ->label('sdk.description', '/docs/references/storage/list-buckets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET_LIST) + ->label('sdk', new Method( + namespace: 'storage', + name: 'listBuckets', + description: '/docs/references/storage/list-buckets.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUCKET_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -211,13 +219,15 @@ App::get('/v1/storage/buckets/:bucketId') ->groups(['api', 'storage']) ->label('scope', 'buckets.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getBucket') - ->label('sdk.description', '/docs/references/storage/get-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getBucket', + description: '/docs/references/storage/get-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUCKET, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') ->inject('dbForProject') @@ -240,13 +250,15 @@ App::put('/v1/storage/buckets/:bucketId') ->label('event', 'buckets.[bucketId].update') ->label('audits.event', 'bucket.update') ->label('audits.resource', 'bucket/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'updateBucket') - ->label('sdk.description', '/docs/references/storage/update-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'updateBucket', + description: '/docs/references/storage/update-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_BUCKET, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->param('name', null, new Text(128), 'Bucket name', false) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) @@ -304,12 +316,14 @@ App::delete('/v1/storage/buckets/:bucketId') ->label('audits.event', 'bucket.delete') ->label('event', 'buckets.[bucketId].delete') ->label('audits.resource', 'bucket/{request.bucketId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'deleteBucket') - ->label('sdk.description', '/docs/references/storage/delete-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'deleteBucket', + description: '/docs/references/storage/delete-bucket.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') ->inject('dbForProject') @@ -350,15 +364,17 @@ App::post('/v1/storage/buckets/:bucketId/files') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'createFile') - ->label('sdk.description', '/docs/references/storage/create-file.md') - ->label('sdk.request.type', 'multipart/form-data') - ->label('sdk.methodType', 'upload') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'createFile', + description: '/docs/references/storage/create-file.md', + methodType: MethodType::UPLOAD, + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + requestType: 'multipart/form-data', + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_FILE, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('file', [], new File(), 'Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).', skipValidation: true) @@ -714,13 +730,15 @@ App::get('/v1/storage/buckets/:bucketId/files') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'listFiles') - ->label('sdk.description', '/docs/references/storage/list-files.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE_LIST) + ->label('sdk', new Method( + namespace: 'storage', + name: 'listFiles', + description: '/docs/references/storage/list-files.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FILE_LIST, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -806,13 +824,15 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFile') - ->label('sdk.description', '/docs/references/storage/get-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFile', + description: '/docs/references/storage/get-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FILE, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -857,13 +877,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ->label('cache', true) ->label('cache.resourceType', 'bucket/{request.bucketId}') ->label('cache.resource', 'file/{request.fileId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFilePreview') - ->label('sdk.description', '/docs/references/storage/get-file-preview.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFilePreview', + description: '/docs/references/storage/get-file-preview.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::IMAGE, + responseModel: Response::MODEL_NONE, + methodType: MethodType::LOCATION, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID') ->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true) @@ -1027,13 +1050,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileDownload') - ->label('sdk.description', '/docs/references/storage/get-file-download.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFileDownload', + description: '/docs/references/storage/get-file-download.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::ANY, + responseModel: Response::MODEL_NONE, + methodType: MethodType::LOCATION, + )) ->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('request') @@ -1168,13 +1194,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileView') - ->label('sdk.description', '/docs/references/storage/get-file-view.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFileView', + description: '/docs/references/storage/get-file-view.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::ANY, + responseModel: Response::MODEL_NONE, + methodType: MethodType::LOCATION, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -1481,13 +1510,15 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'updateFile') - ->label('sdk.description', '/docs/references/storage/update-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'updateFile', + description: '/docs/references/storage/update-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_FILE, + responseType: ResponseType::JSON, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('name', null, new Text(255), 'Name of the file', true) @@ -1590,12 +1621,14 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'deleteFile') - ->label('sdk.description', '/docs/references/storage/delete-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'deleteFile', + description: '/docs/references/storage/delete-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -1682,12 +1715,15 @@ App::get('/v1/storage/usage') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_STORAGE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getUsage', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USAGE_STORAGE, + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') @@ -1762,12 +1798,15 @@ App::get('/v1/storage/:bucketId/usage') ->groups(['api', 'storage']) ->label('scope', 'files.read') ->label('resourceType', RESOURCE_TYPE_BUCKETS) - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getBucketUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getBucketUsage', + description: '/docs/references/storage/get-bucket-usage.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + responseModel: Response::MODEL_USAGE_BUCKETS, + )) ->param('bucketId', '', new UID(), 'Bucket ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index be055f0935..fc249e9c48 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -11,6 +11,9 @@ use Appwrite\Event\Messaging; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\Platform\Workers\Deletes; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -53,13 +56,15 @@ App::post('/v1/teams') ->label('scope', 'teams.write') ->label('audits.event', 'team.create') ->label('audits.resource', 'team/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/teams/create-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) + ->label('sdk', new Method( + namespace: 'teams', + name: 'create', + description: '/docs/references/teams/create-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_TEAM, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new CustomId(), 'Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') ->param('roles', ['owner'], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', true) @@ -138,14 +143,16 @@ App::get('/v1/teams') ->desc('List teams') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/teams/list-teams.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM_LIST) - ->label('sdk.offline.model', '/teams') + ->label('sdk', new Method( + namespace: 'teams', + name: 'list', + description: '/docs/references/teams/list-teams.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TEAM_LIST, + responseType: ResponseType::JSON, + offlineModel: '/teams', + )) ->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -202,15 +209,17 @@ App::get('/v1/teams/:teamId') ->desc('Get team') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/teams/get-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) - ->label('sdk.offline.model', '/teams') - ->label('sdk.offline.key', '{teamId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'get', + description: '/docs/references/teams/get-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TEAM, + responseType: ResponseType::JSON, + offlineModel: '/teams', + offlineKey: '{teamId}', + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('dbForProject') @@ -229,14 +238,16 @@ App::get('/v1/teams/:teamId/prefs') ->desc('Get team preferences') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/teams/get-team-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/teams/{teamId}/prefs') + ->label('sdk', new Method( + namespace: 'teams', + name: 'getPrefs', + description: '/docs/references/teams/get-team-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/prefs', + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('dbForProject') @@ -260,15 +271,17 @@ App::put('/v1/teams/:teamId') ->label('scope', 'teams.write') ->label('audits.event', 'team.update') ->label('audits.resource', 'team/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/teams/update-team-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) - ->label('sdk.offline.model', '/teams') - ->label('sdk.offline.key', '{teamId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateName', + description: '/docs/references/teams/update-team-name.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TEAM, + responseType: ResponseType::JSON, + offlineModel: '/teams', + offlineKey: '{teamId}', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('name', null, new Text(128), 'New team name. Max length: 128 chars.') ->inject('requestTimestamp') @@ -304,14 +317,16 @@ App::put('/v1/teams/:teamId/prefs') ->label('audits.event', 'team.update') ->label('audits.resource', 'team/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/teams/update-team-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/teams/{teamId}/prefs') + ->label('sdk', new Method( + namespace: 'teams', + name: 'updatePrefs', + description: '/docs/references/teams/update-team-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/prefs', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') ->inject('response') @@ -339,12 +354,14 @@ App::delete('/v1/teams/:teamId') ->label('scope', 'teams.write') ->label('audits.event', 'team.delete') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/teams/delete-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'teams', + name: 'delete', + description: '/docs/references/teams/delete-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('getProjectDB') @@ -390,13 +407,15 @@ App::post('/v1/teams/:teamId/memberships') ->label('audits.event', 'membership.create') ->label('audits.resource', 'team/{request.teamId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'createMembership') - ->label('sdk.description', '/docs/references/teams/create-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'createMembership', + description: '/docs/references/teams/create-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON, + )) ->label('abuse-limit', 10) ->param('teamId', '', new UID(), 'Team ID.') ->param('email', '', new Email(), 'Email of the new team member.', true) @@ -715,14 +734,16 @@ App::get('/v1/teams/:teamId/memberships') ->desc('List team memberships') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'listMemberships') - ->label('sdk.description', '/docs/references/teams/list-team-members.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST) - ->label('sdk.offline.model', '/teams/{teamId}/memberships') + ->label('sdk', new Method( + namespace: 'teams', + name: 'listMemberships', + description: '/docs/references/teams/list-team-members.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP_LIST, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/memberships', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -846,15 +867,17 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') ->desc('Get team membership') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'getMembership') - ->label('sdk.description', '/docs/references/teams/get-team-member.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) - ->label('sdk.offline.model', '/teams/{teamId}/memberships') - ->label('sdk.offline.key', '{membershipId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'getMembership', + description: '/docs/references/teams/get-team-member.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON, + offlineModel: '/teams/{teamId}/memberships', + offlineKey: '{membershipId}', + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->inject('response') @@ -927,13 +950,15 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') ->label('scope', 'teams.write') ->label('audits.event', 'membership.update') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateMembership') - ->label('sdk.description', '/docs/references/teams/update-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateMembership', + description: '/docs/references/teams/update-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->param('roles', [], function (Document $project) { @@ -1010,13 +1035,15 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->label('audits.event', 'membership.update') ->label('audits.resource', 'team/{request.teamId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateMembershipStatus') - ->label('sdk.description', '/docs/references/teams/update-team-membership-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateMembershipStatus', + description: '/docs/references/teams/update-team-membership-status.md', + auth: [AuthType::SESSION, AuthType::JWT], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP, + responseType: ResponseType::JSON + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->param('userId', '', new UID(), 'User ID.') @@ -1147,12 +1174,15 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') ->label('scope', 'teams.write') ->label('audits.event', 'membership.delete') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'deleteMembership') - ->label('sdk.description', '/docs/references/teams/delete-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'teams', + name: 'deleteMembership', + description: '/docs/references/teams/delete-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->inject('response') @@ -1210,13 +1240,15 @@ App::get('/v1/teams/:teamId/logs') ->desc('List team logs') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/teams/get-team-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'teams', + name: 'listLogs', + description: '/docs/references/teams/get-team-logs.md', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON, + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 42f7a59f54..2898567280 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -15,6 +15,9 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -192,6 +195,15 @@ App::post('/v1/users') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'create', + description: '/docs/references/users/create-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', null, new Email(), 'User email.', true) ->param('phone', null, new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -214,13 +226,15 @@ App::post('/v1/users/bcrypt') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createBcryptUser') - ->label('sdk.description', '/docs/references/users/create-bcrypt-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createBcryptUser', + description: '/docs/references/users/create-bcrypt-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Bcrypt.') @@ -243,13 +257,15 @@ App::post('/v1/users/md5') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createMD5User') - ->label('sdk.description', '/docs/references/users/create-md5-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createMD5User', + description: '/docs/references/users/create-md5-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using MD5.') @@ -272,13 +288,15 @@ App::post('/v1/users/argon2') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createArgon2User') - ->label('sdk.description', '/docs/references/users/create-argon2-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createArgon2User', + description: '/docs/references/users/create-argon2-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Argon2.') @@ -301,13 +319,15 @@ App::post('/v1/users/sha') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createSHAUser') - ->label('sdk.description', '/docs/references/users/create-sha-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createSHAUser', + description: '/docs/references/users/create-sha-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using SHA.') @@ -337,13 +357,15 @@ App::post('/v1/users/phpass') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createPHPassUser') - ->label('sdk.description', '/docs/references/users/create-phpass-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createPHPassUser', + description: '/docs/references/users/create-phpass-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using PHPass.') @@ -366,13 +388,15 @@ App::post('/v1/users/scrypt') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createScryptUser') - ->label('sdk.description', '/docs/references/users/create-scrypt-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createScryptUser', + description: '/docs/references/users/create-scrypt-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Scrypt.') @@ -408,13 +432,15 @@ App::post('/v1/users/scrypt-modified') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createScryptModifiedUser') - ->label('sdk.description', '/docs/references/users/create-scrypt-modified-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createScryptModifiedUser', + description: '/docs/references/users/create-scrypt-modified-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Scrypt Modified.') @@ -441,13 +467,15 @@ App::post('/v1/users/:userId/targets') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].create') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createTarget') - ->label('sdk.description', '/docs/references/users/create-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'createTarget', + description: '/docs/references/users/create-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_TARGET, + responseType: ResponseType::JSON, + )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('userId', '', new UID(), 'User ID.') ->param('providerType', '', new WhiteList([MESSAGE_TYPE_EMAIL, MESSAGE_TYPE_SMS, MESSAGE_TYPE_PUSH]), 'The target provider type. Can be one of the following: `email`, `sms` or `push`.') @@ -527,13 +555,15 @@ App::get('/v1/users') ->desc('List users') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/users/list-users.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'list', + description: '/docs/references/users/list-users.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -587,13 +617,15 @@ App::get('/v1/users/:userId') ->desc('Get user') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/users/get-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'get', + description: '/docs/references/users/get-user.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -612,13 +644,15 @@ App::get('/v1/users/:userId/prefs') ->desc('Get user preferences') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/users/get-user-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) + ->label('sdk', new Method( + namespace: 'users', + name: 'getPrefs', + description: '/docs/references/users/get-user-prefs.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -639,13 +673,15 @@ App::get('/v1/users/:userId/targets/:targetId') ->desc('Get user target') ->groups(['api', 'users']) ->label('scope', 'targets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getTarget') - ->label('sdk.description', '/docs/references/users/get-user-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'getTarget', + description: '/docs/references/users/get-user-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TARGET, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->inject('response') @@ -671,13 +707,15 @@ App::get('/v1/users/:userId/sessions') ->desc('List user sessions') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listSessions') - ->label('sdk.description', '/docs/references/users/list-user-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listSessions', + description: '/docs/references/users/list-user-sessions.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_SESSION_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -712,13 +750,15 @@ App::get('/v1/users/:userId/memberships') ->desc('List user memberships') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listMemberships') - ->label('sdk.description', '/docs/references/users/list-user-memberships.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listMemberships', + description: '/docs/references/users/list-user-memberships.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MEMBERSHIP_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -751,13 +791,15 @@ App::get('/v1/users/:userId/logs') ->desc('List user logs') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/users/list-user-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listLogs', + description: '/docs/references/users/list-user-logs.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_LOG_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -840,13 +882,15 @@ App::get('/v1/users/:userId/targets') ->desc('List user targets') ->groups(['api', 'users']) ->label('scope', 'targets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listTargets') - ->label('sdk.description', '/docs/references/users/list-user-targets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listTargets', + description: '/docs/references/users/list-user-targets.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TARGET_LIST, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -900,13 +944,15 @@ App::get('/v1/users/identities') ->desc('List identities') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listIdentities') - ->label('sdk.description', '/docs/references/users/list-identities.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_IDENTITY_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listIdentities', + description: '/docs/references/users/list-identities.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_IDENTITY_LIST, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -964,13 +1010,15 @@ App::patch('/v1/users/:userId/status') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateStatus') - ->label('sdk.description', '/docs/references/users/update-user-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateStatus', + description: '/docs/references/users/update-user-status.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('status', null, new Boolean(true), 'User Status. To activate the user pass `true` and to block the user pass `false`.') ->inject('response') @@ -999,13 +1047,15 @@ App::put('/v1/users/:userId/labels') ->label('scope', 'users.write') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateLabels') - ->label('sdk.description', '/docs/references/users/update-user-labels.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateLabels', + description: '/docs/references/users/update-user-labels.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('labels', [], new ArrayList(new Text(36, allowList: [...Text::NUMBERS, ...Text::ALPHABET_UPPER, ...Text::ALPHABET_LOWER]), APP_LIMIT_ARRAY_LABELS_SIZE), 'Array of user labels. Replaces the previous labels. Maximum of ' . APP_LIMIT_ARRAY_LABELS_SIZE . ' labels are allowed, each up to 36 alphanumeric characters long.') ->inject('response') @@ -1036,13 +1086,15 @@ App::patch('/v1/users/:userId/verification/phone') ->label('scope', 'users.write') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePhoneVerification') - ->label('sdk.description', '/docs/references/users/update-user-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePhoneVerification', + description: '/docs/references/users/update-user-phone-verification.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('phoneVerification', false, new Boolean(), 'User phone verification status.') ->inject('response') @@ -1072,13 +1124,15 @@ App::patch('/v1/users/:userId/name') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/users/update-user-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateName', + description: '/docs/references/users/update-user-name.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('name', '', new Text(128, 0), 'User name. Max length: 128 chars.') ->inject('response') @@ -1109,13 +1163,15 @@ App::patch('/v1/users/:userId/password') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePassword') - ->label('sdk.description', '/docs/references/users/update-user-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePassword', + description: '/docs/references/users/update-user-password.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, enabled: $project->getAttribute('auths', [])['passwordDictionary'] ?? false, allowEmpty: true), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) ->inject('response') @@ -1186,13 +1242,15 @@ App::patch('/v1/users/:userId/email') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/users/update-user-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateEmail', + description: '/docs/references/users/update-user-email.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('email', '', new Email(allowEmpty: true), 'User email.') ->inject('response') @@ -1280,13 +1338,15 @@ App::patch('/v1/users/:userId/phone') ->label('scope', 'users.write') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePhone') - ->label('sdk.description', '/docs/references/users/update-user-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePhone', + description: '/docs/references/users/update-user-phone.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('number', '', new Phone(allowEmpty: true), 'User phone number.') ->inject('response') @@ -1364,13 +1424,15 @@ App::patch('/v1/users/:userId/verification') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{request.userId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateEmailVerification') - ->label('sdk.description', '/docs/references/users/update-user-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateEmailVerification', + description: '/docs/references/users/update-user-email-verification.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('emailVerification', false, new Boolean(), 'User email verification status.') ->inject('response') @@ -1396,13 +1458,15 @@ App::patch('/v1/users/:userId/prefs') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.prefs') ->label('scope', 'users.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/users/update-user-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePrefs', + description: '/docs/references/users/update-user-prefs.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_PREFERENCES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') ->inject('response') @@ -1431,13 +1495,15 @@ App::patch('/v1/users/:userId/targets/:targetId') ->label('audits.resource', 'target/{response.$id}') ->label('event', 'users.[userId].targets.[targetId].update') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateTarget') - ->label('sdk.description', '/docs/references/users/update-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateTarget', + description: '/docs/references/users/update-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_TARGET, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)', true) @@ -1530,13 +1596,15 @@ App::patch('/v1/users/:userId/mfa') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateMfa') - ->label('sdk.description', '/docs/references/users/update-user-mfa.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateMfa', + description: '/docs/references/users/update-user-mfa.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('response') @@ -1564,13 +1632,15 @@ App::get('/v1/users/:userId/mfa/factors') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listMfaFactors') - ->label('sdk.description', '/docs/references/users/list-mfa-factors.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_FACTORS) + ->label('sdk', new Method( + namespace: 'users', + name: 'listMfaFactors', + description: '/docs/references/users/list-mfa-factors.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MFA_FACTORS, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1597,13 +1667,15 @@ App::get('/v1/users/:userId/mfa/recovery-codes') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/get-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'getMfaRecoveryCodes', + description: '/docs/references/users/get-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1636,13 +1708,15 @@ App::patch('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/create-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'createMfaRecoveryCodes', + description: '/docs/references/users/create-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1682,13 +1756,15 @@ App::put('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/update-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/users/update-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_MFA_RECOVERY_CODES, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1727,13 +1803,15 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteMfaAuthenticator') - ->label('sdk.description', '/docs/references/users/delete-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteMfaAuthenticator', + description: '/docs/references/users/delete-mfa-authenticator.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USER, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -1768,13 +1846,15 @@ App::post('/v1/users/:userId/sessions') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{request.userId}') ->label('usage.metric', 'sessions.{scope}.requests.create') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createSession') - ->label('sdk.description', '/docs/references/users/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'users', + name: 'createSession', + description: '/docs/references/users/create-session.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_SESSION, + responseType: ResponseType::JSON, + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->inject('request') ->inject('response') @@ -1837,13 +1917,15 @@ App::post('/v1/users/:userId/tokens') ->label('scope', 'users.write') ->label('audits.event', 'tokens.create') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createToken') - ->label('sdk.description', '/docs/references/users/create-token.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'users', + name: 'createToken', + description: '/docs/references/users/create-token.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_TOKEN, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('length', 6, new Range(4, 128), 'Token length in characters. The default length is 6 characters', true) ->param('expire', Auth::TOKEN_EXPIRATION_GENERIC, new Range(60, Auth::TOKEN_EXPIRATION_LOGIN_LONG), 'Token expiration period in seconds. The default expiration is 15 minutes.', true) @@ -1894,12 +1976,15 @@ App::delete('/v1/users/:userId/sessions/:sessionId') ->label('scope', 'users.write') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteSession') - ->label('sdk.description', '/docs/references/users/delete-user-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteSession', + description: '/docs/references/users/delete-user-session.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') ->inject('response') @@ -1937,12 +2022,15 @@ App::delete('/v1/users/:userId/sessions') ->label('scope', 'users.write') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteSessions') - ->label('sdk.description', '/docs/references/users/delete-user-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteSessions', + description: '/docs/references/users/delete-user-sessions.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1979,12 +2067,15 @@ App::delete('/v1/users/:userId') ->label('scope', 'users.write') ->label('audits.event', 'user.delete') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/users/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'delete', + description: '/docs/references/users/delete.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -2021,13 +2112,15 @@ App::delete('/v1/users/:userId/targets/:targetId') ->label('audits.resource', 'target/{request.$targetId}') ->label('event', 'users.[userId].targets.[targetId].delete') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteTarget') - ->label('sdk.description', '/docs/references/users/delete-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteTarget', + description: '/docs/references/users/delete-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -2072,12 +2165,15 @@ App::delete('/v1/users/identities/:identityId') ->label('scope', 'users.write') ->label('audits.event', 'identity.delete') ->label('audits.resource', 'identity/{request.$identityId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteIdentity') - ->label('sdk.description', '/docs/references/users/delete-identity.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteIdentity', + description: '/docs/references/users/delete-identity.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_NOCONTENT, + responseModel: Response::MODEL_NONE, + responseType: ResponseType::JSON, + )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') ->inject('dbForProject') @@ -2104,13 +2200,15 @@ App::post('/v1/users/:userId/jwts') ->desc('Create user JWT') ->groups(['api', 'users']) ->label('scope', 'users.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/users/create-user-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'users', + name: 'createJWT', + description: '/docs/references/users/create-user-jwt.md', + auth: [AuthType::KEY], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_JWT, + responseType: ResponseType::JSON, + )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID. Use the string \'recent\' to use the most recent session. Defaults to the most recent session.', true) ->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true) @@ -2154,12 +2252,15 @@ App::get('/v1/users/usage') ->desc('Get users usage stats') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_USERS) + ->label('sdk', new Method( + namespace: 'users', + name: 'getUsage', + description: '', + auth: [AuthType::ADMIN], + responseCode: Response::STATUS_CODE_OK, + responseModel: Response::MODEL_USAGE_USERS, + responseType: ResponseType::JSON, + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index bbb1d9c3f8..526fee27f9 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -4,6 +4,10 @@ use Appwrite\Auth\OAuth2\Github as OAuth2Github; use Appwrite\Event\Build; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -269,13 +273,17 @@ App::get('/v1/vcs/github/authorize') ->label('scope', 'vcs.read') ->label('sdk.namespace', 'vcs') ->label('error', __DIR__ . '/../../views/general/error.phtml') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createGitHubInstallation') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') - ->label('sdk.hide', true) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createGitHubInstallation', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responseType: ResponseType::HTML, + methodType: MethodType::WEBAUTH, + hide: true, + )) ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients']) ->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients']) ->inject('request') @@ -467,13 +475,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('Get files and directories of a VCS repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getRepositoryContents') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VCS_CONTENT_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getRepositoryContents', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_VCS_CONTENT_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to get contents of nested directory', true) @@ -528,13 +538,15 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr ->desc('Detect runtime settings from source code') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createRepositoryDetection') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DETECTION) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createRepositoryDetection', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_DETECTION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to Root Directory', true) @@ -600,13 +612,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories') ->desc('List repositories') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listRepositories') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listRepositories', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_PROVIDER_REPOSITORY_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('gitHub') @@ -695,13 +709,15 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') ->desc('Create repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createRepository') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createRepository', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_PROVIDER_REPOSITORY, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('name', '', new Text(256), 'Repository name (slug)') ->param('private', '', new Boolean(false), 'Mark repository public or private') @@ -796,13 +812,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('Get repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getRepository') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getRepository', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_PROVIDER_REPOSITORY, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->inject('gitHub') @@ -845,13 +863,15 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('List repository branches') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listRepositoryBranches') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BRANCH_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listRepositoryBranches', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_BRANCH_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->inject('gitHub') @@ -1033,13 +1053,15 @@ App::get('/v1/vcs/installations') ->desc('List installations') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listInstallations') - ->label('sdk.description', '/docs/references/vcs/list-installations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INSTALLATION_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listInstallations', + description: '/docs/references/vcs/list-installations.md', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_INSTALLATION_LIST, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('queries', [], new Installations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Installations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -1099,13 +1121,15 @@ App::get('/v1/vcs/installations/:installationId') ->desc('Get installation') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getInstallation') - ->label('sdk.description', '/docs/references/vcs/get-installation.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INSTALLATION) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getInstallation', + description: '/docs/references/vcs/get-installation.md', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_INSTALLATION, + responseCode: Response::STATUS_CODE_OK, + responseType: ResponseType::JSON, + )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') ->inject('project') @@ -1128,12 +1152,14 @@ App::delete('/v1/vcs/installations/:installationId') ->desc('Delete installation') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'deleteInstallation') - ->label('sdk.description', '/docs/references/vcs/delete-installation.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'deleteInstallation', + description: '/docs/references/vcs/delete-installation.md', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_NOCONTENT + )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') ->inject('project') @@ -1161,12 +1187,14 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor ->desc('Authorize external deployment') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'updateExternalDeployments') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'updateExternalDeployments', + description: '', + auth: [AuthType::ADMIN], + responseModel: Response::MODEL_NONE, + responseCode: Response::STATUS_CODE_NOCONTENT + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('repositoryId', '', new Text(256), 'VCS Repository Id') ->param('providerPullRequestId', '', new Text(256), 'GitHub Pull Request Id') diff --git a/app/controllers/mock.php b/app/controllers/mock.php index bc071fc885..fd0a891a94 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -24,7 +24,7 @@ App::get('/v1/mock/tests/general/oauth2') ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->label('sdk.mock', true) + ->label('mock', true) ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') // Important to deny an open redirect attack ->param('scope', '', new Text(100), 'OAuth2 scope list.') @@ -40,7 +40,7 @@ App::get('/v1/mock/tests/general/oauth2/token') ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->label('sdk.mock', true) + ->label('mock', true) ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') ->param('client_secret', '', new Text(100), 'OAuth2 scope list.') ->param('grant_type', 'authorization_code', new WhiteList(['refresh_token', 'authorization_code']), 'OAuth2 Grant Type.', true) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index a49ad11a10..d0d433410b 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -343,11 +343,16 @@ App::init() } /** Do not allow access to disabled services */ - $service = $route->getLabel('sdk.namespace', ''); - if (!empty($service)) { + /** + * @var ?\Appwrite\SDK\Method $method + */ + $method = $route->getLabel('sdk', false); + + if (!empty($method)) { + $namespace = $method->getNamespace(); if ( - array_key_exists($service, $project->getAttribute('services', [])) - && !$project->getAttribute('services', [])[$service] + array_key_exists($namespace, $project->getAttribute('services', [])) + && !$project->getAttribute('services', [])[$namespace] && !(Auth::isPrivilegedUser(Authorization::getRoles()) || Auth::isAppUser(Authorization::getRoles())) ) { throw new Exception(Exception::GENERAL_SERVICE_DISABLED); diff --git a/docs/references/account/create-push-target.md b/docs/references/account/create-push-target.md new file mode 100644 index 0000000000..7535bd1f6b --- /dev/null +++ b/docs/references/account/create-push-target.md @@ -0,0 +1 @@ +Use this endpoint to update an existing push target for messages for the currently logged in user. \ No newline at end of file diff --git a/docs/references/account/delete-push-target.md b/docs/references/account/delete-push-target.md new file mode 100644 index 0000000000..6dd2c50d97 --- /dev/null +++ b/docs/references/account/delete-push-target.md @@ -0,0 +1 @@ +Use this endpoint to delete an existing push target for messages for the currently logged in user. \ No newline at end of file diff --git a/docs/references/account/update-push-target.md b/docs/references/account/update-push-target.md new file mode 100644 index 0000000000..674d27193c --- /dev/null +++ b/docs/references/account/update-push-target.md @@ -0,0 +1 @@ +Use this endpoint to create a new push target for messages for the currently logged in user. \ No newline at end of file diff --git a/docs/references/health/get-version.md b/docs/references/health/get-version.md new file mode 100644 index 0000000000..4247ecdaed --- /dev/null +++ b/docs/references/health/get-version.md @@ -0,0 +1 @@ +Get the version of Appwrite that this instance is currently running. \ No newline at end of file diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index 833ea9d032..b8daadefef 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -98,14 +98,17 @@ class Schema foreach ($routes as $route) { /** @var Route $route */ - $namespace = $route->getLabel('sdk.namespace', ''); - $method = $route->getLabel('sdk.method', ''); - $name = $namespace . \ucfirst($method); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); - if (empty($name)) { + if (empty($sdk)) { continue; } + $namespace = $sdk->getNamespace(); + $method = $sdk->getMethodName(); + $name = $namespace . \ucfirst($method); + foreach (Mapper::route($utopia, $route, $complexity) as $field) { switch ($route->getMethod()) { case 'GET': diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index d8f1d7da09..35cc9e28cc 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -86,7 +86,14 @@ class Mapper } } - $names = $route->getLabel('sdk.response.model', 'none'); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); + + if (!$sdk) { + return; + } + + $names = $sdk->getResponseModel() ?? []; $models = \is_array($names) ? \array_map(static fn ($m) => static::$models[$m], $names) : [static::$models[$names]]; diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index f71de98d95..6229899a9a 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Tasks; +use Appwrite\SDK\AuthType; use Appwrite\Specification\Format\OpenAPI3; use Appwrite\Specification\Format\Swagger2; use Appwrite\Specification\Specification; @@ -182,25 +183,31 @@ class Specs extends Action foreach ($appRoutes as $key => $method) { foreach ($method as $route) { - $hide = $route->getLabel('sdk.hide', false); + $sdk = $route->getLabel('sdk', false); + + /** @var \Appwrite\SDK\Method $sdk */ + if (empty($sdk)) { + continue; + } + + $hide = $sdk->isHidden(); if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { continue; } - /** @var \Utopia\Route $route */ - $routeSecurity = $route->getLabel('sdk.auth', []); + $routeSecurity = $sdk->getAuth(); $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_JWT: - case APP_AUTH_TYPE_KEY: + case AuthType::JWT: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -215,15 +222,15 @@ class Specs extends Action continue; } - if ($route->getLabel('sdk.mock', false) && !$mocks) { + if ($route->getLabel('mock', false) && !$mocks) { continue; } - if (!$route->getLabel('sdk.mock', false) && $mocks) { + if (!$route->getLabel('mock', false) && $mocks) { continue; } - if (empty($route->getLabel('sdk.namespace', null))) { + if (empty($sdk->getNamespace())) { continue; } diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php new file mode 100644 index 0000000000..0ae9451b6c --- /dev/null +++ b/src/Appwrite/SDK/Method.php @@ -0,0 +1,222 @@ + $authTypes + * @param string $namespace + * @param MethodType $methodType + * @param string $desc + * @param int $responseCode + * @param string $responseModel + * @param string $offlineKey + * @param string $offlineModel + * + * @throws \Exception + */ + public function __construct( + protected string $namespace, + protected string $name, + protected string $description, + protected array $auth, + protected int $responseCode, + protected string|array $responseModel, + protected ResponseType $responseType = ResponseType::JSON, + protected ?MethodType $methodType = null, + protected ?string $offlineKey = null, + protected ?string $offlineModel = null, + protected ?string $offlineResponseKey = null, + protected bool $deprecated = false, + protected array|bool $hide = false, + protected bool $packaging = false, + protected string $requestType = 'application/json', + protected array $parameters = [], + ) + { + $this->validateMethod($name, $namespace); + $this->validateAuthTypes($auth); + // Disabled for now, will be enabled later + // $this->validateDesc($description); + $this->validateResponseModel($responseModel); + + // No content check + if ($responseCode === 204) { + if ($responseModel !== Response::MODEL_NONE) { + throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + } + } + } + + private function getDebugName(): string + { + return $this->namespace . '.' . $this->name; + } + + private function validateMethod(string $name, string $namespace): void + { + if (\in_array($this->getDebugName(), self::$knownMethods)) { + throw new \Exception('Method ' . $name . ' already exists in namespace ' . $namespace); + } + + self::$knownMethods[] = $this->getDebugName(); + } + + private function validateAuthTypes(array $authTypes): void + { + foreach ($authTypes as $authType) { + if (!($authType instanceof AuthType)) { + throw new \Exception("Error with {$this->getDebugName()} method: Invalid auth type"); + } + } + } + + private function validateDesc(string $desc): void + { + if (empty($desc)) { + throw new \Exception("Error with {$this->getDebugName()} method: Description file not set"); + } + + $descPath = \realpath(__DIR__ . '/../../../' . $desc); + + if (!\file_exists($descPath)) { + throw new \Exception("Error with {$this->getDebugName()} method: Description file not found at {$descPath}"); + } + } + + private function validateResponseModel(string|array $responseModel): void + { + $response = new Response(new HttpResponse()); + + if (\is_array($responseModel)) { + foreach ($responseModel as $model) { + try { + $response->getModel($model); + } catch (\Exception $e) { + throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + } + } + + return; + } + + try { + $response->getModel($responseModel); + } catch (\Exception $e) { + throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + } + } + + public function getNamespace(): string + { + return $this->namespace; + } + + public function getMethodName(): string + { + return $this->name; + } + + public function getDescription(): string + { + return $this->description; + } + + public function getAuth(): array + { + return $this->auth; + } + + public function getResponseCode(): int + { + return $this->responseCode; + } + + public function getResponseModel(): string|array + { + return $this->responseModel; + } + + public function getResponseType(): ResponseType + { + return $this->responseType; + } + + public function getMethodType(): ?MethodType + { + return $this->methodType; + } + + public function getOfflineKey(): ?string + { + return $this->offlineKey; + } + + public function getOfflineModel(): ?string + { + return $this->offlineModel; + } + + public function getOfflineResponseKey(): ?string + { + return $this->offlineResponseKey; + } + + public function isDeprecated(): bool + { + return $this->deprecated; + } + + public function isHidden(): bool|array + { + return $this->hide ?? false; + } + + public function isPackaging(): bool + { + return $this->packaging; + } + + public function getRequestType(): string + { + return $this->requestType; + } + + public function getParameters(): array + { + return $this->parameters; + } +} \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 4dc6e222e0..d18f1e9120 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -2,6 +2,8 @@ namespace Appwrite\Specification\Format; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\MethodType; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -120,32 +122,42 @@ class OpenAPI3 extends Format foreach ($this->routes as $route) { $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); - $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; - $method = $route->getLabel('sdk.method', \uniqid()); + $sdk = $route->getLabel('sdk', false); + + if (empty($sdk)) { + continue; + } + + /** + * @var \Appwrite\SDK\Method $sdk + */ + $consumes = [$sdk->getRequestType()]; + + $method = $sdk->getMethodName() ?? \uniqid(); if (!empty($method) && is_array($method)) { $method = array_keys($method)[0]; } - $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; - $produces = $route->getLabel('sdk.response.type', null); - $model = $route->getLabel('sdk.response.model', 'none'); - $routeSecurity = $route->getLabel('sdk.auth', []); + $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; + $produces = ($sdk->getResponseType())->value; + $model = $sdk->getResponseModel() ?? 'none'; + $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_KEY: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_JWT: + case AuthType::JWT: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -156,34 +168,36 @@ class OpenAPI3 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $namespace = $sdk->getNamespace() ?? 'default'; + $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method), - 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'operationId' => $namespace . ucfirst($method), + 'tags' => [$namespace], 'description' => ($desc) ? \file_get_contents($desc) : '', 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $route->getLabel('sdk.methodType', ''), - 'deprecated' => $route->getLabel('sdk.deprecated', false), - 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md', - 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), + 'type' => $sdk->getMethodType()->value ?? '', + 'deprecated' => $sdk->isDeprecated(), + 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $route->getLabel('sdk.packaging', false), - 'offline-model' => $route->getLabel('sdk.offline.model', ''), - 'offline-key' => $route->getLabel('sdk.offline.key', ''), - 'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'), + 'packaging' => $sdk->isPackaging(), + 'offline-model' => $sdk->getOfflineModel() ?? '', + 'offline-key' => $sdk->getOfflineKey() ?? '', + 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', ], ]; - if (is_array($route->getLabel('sdk.method', ''))) { - $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + if (is_array($sdk->getMethodName() ?? '')) { + $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); } foreach ($this->models as $value) { @@ -198,7 +212,7 @@ class OpenAPI3 extends Format } if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => in_array($produces, [ 'image/*', 'image/jpeg', @@ -219,7 +233,7 @@ class OpenAPI3 extends Format $usedModels[] = $m->getType(); } - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $modelDescription, 'content' => [ $produces => [ @@ -232,7 +246,7 @@ class OpenAPI3 extends Format } else { // Response definition using one type $usedModels[] = $model->getType(); - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $model->getName(), 'content' => [ $produces => [ @@ -245,17 +259,18 @@ class OpenAPI3 extends Format } } - if ($route->getLabel('sdk.response.code', 500) === 204) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content'; - unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']); + if (($sdk->getResponseCode() ?? 500) === 204) { + $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); } if ((!empty($scope))) { // && 'public' != $scope $securities = ['Project' => []]; - foreach ($route->getLabel('sdk.auth', []) as $security) { - if (array_key_exists($security, $this->keys)) { - $securities[$security] = []; + foreach ($sdk->getAuth() as $security) { + /** @var \Appwrite\SDK\AuthType $security */ + if (array_key_exists($security->value, $this->keys)) { + $securities[$security->value] = []; } } @@ -306,7 +321,7 @@ class OpenAPI3 extends Format $node['schema']['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($route->getLabel('sdk.methodType', '') === 'upload') { + if ($sdk->getMethodType() === MethodType::UPLOAD) { $node['schema']['x-upload-id'] = true; } $node['schema']['type'] = $validator->getType(); @@ -430,7 +445,7 @@ class OpenAPI3 extends Format $allowed = true; foreach ($this->enumBlacklist as $blacklist) { if ( - $blacklist['namespace'] == $route->getLabel('sdk.namespace', '') + $blacklist['namespace'] == $sdk->getNamespace() && $blacklist['method'] == $method && $blacklist['parameter'] == $name ) { @@ -441,8 +456,8 @@ class OpenAPI3 extends Format if ($allowed) { $node['schema']['enum'] = $validator->getList(); - $node['schema']['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name); - $node['schema']['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name); + $node['schema']['x-enum-name'] = $this->getEnumName($sdk->getNamespace() ?? '', $method, $name); + $node['schema']['x-enum-keys'] = $this->getEnumKeys($sdk->getNamespace() ?? '', $method, $name); } if ($validator->getType() === 'integer') { $node['format'] = 'int32'; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index d9d2307e07..2595e59f50 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -2,6 +2,8 @@ namespace Appwrite\Specification\Format; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\MethodType; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -118,32 +120,40 @@ class Swagger2 extends Format /** @var \Utopia\Route $route */ $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); - $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; - $method = $route->getLabel('sdk.method', \uniqid()); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); + + if (empty($sdk)) { + continue; + } + + $consumes = [$sdk->getRequestType()]; + + $method = $sdk->getMethodName() ?? \uniqid(); if (!empty($method) && is_array($method)) { $method = array_keys($method)[0]; } - $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; - $produces = $route->getLabel('sdk.response.type', null); - $model = $route->getLabel('sdk.response.model', 'none'); - $routeSecurity = $route->getLabel('sdk.auth', []); + $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; + $produces = ($sdk->getResponseType())->value; + $model = $sdk->getResponseModel() ?? 'none'; + $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_KEY: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_JWT: + case AuthType::JWT: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -154,31 +164,33 @@ class Swagger2 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $namespace = $sdk->getNamespace() ?? 'default'; + $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method), + 'operationId' => $namespace . ucfirst($method), 'consumes' => [], 'produces' => [], - 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'tags' => [$namespace], 'description' => ($desc) ? \file_get_contents($desc) : '', 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $route->getLabel('sdk.methodType', ''), - 'deprecated' => $route->getLabel('sdk.deprecated', false), - 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md', - 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), + 'type' => $sdk->getMethodType()->value ?? '', + 'deprecated' => $sdk->isDeprecated(), + 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $route->getLabel('sdk.packaging', false), - 'offline-model' => $route->getLabel('sdk.offline.model', ''), - 'offline-key' => $route->getLabel('sdk.offline.key', ''), - 'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'), + 'packaging' => $sdk->isPackaging(), + 'offline-model' => $sdk->getOfflineModel() ?? '', + 'offline-key' => $sdk->getOfflineKey() ?? '', + 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', ], ]; @@ -186,8 +198,8 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } - if (is_array($route->getLabel('sdk.method', ''))) { - $temp['x-appwrite']['multiplex'] = $route->getLabel('sdk.method', ''); + if (is_array($sdk->getMethodName() ?? '')) { + $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); } foreach ($this->models as $value) { @@ -202,7 +214,7 @@ class Swagger2 extends Format } if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => in_array($produces, [ 'image/*', 'image/jpeg', @@ -224,7 +236,7 @@ class Swagger2 extends Format foreach ($model as $m) { $usedModels[] = $m->getType(); } - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $modelDescription, 'schema' => [ 'x-oneOf' => \array_map(function ($m) { @@ -235,7 +247,7 @@ class Swagger2 extends Format } else { // Response definition using one type $usedModels[] = $model->getType(); - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ + $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ 'description' => $model->getName(), 'schema' => [ '$ref' => '#/definitions/' . $model->getType(), @@ -244,17 +256,18 @@ class Swagger2 extends Format } } - if (in_array($route->getLabel('sdk.response.code', 500), [204, 301, 302, 308], true)) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content'; - unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']); + if (in_array($sdk->getResponseCode() ?? 500, [204, 301, 302, 308], true)) { + $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); } if ((!empty($scope))) { // && 'public' != $scope $securities = ['Project' => []]; - foreach ($route->getLabel('sdk.auth', []) as $security) { - if (array_key_exists($security, $this->keys)) { - $securities[$security] = []; + foreach ($sdk->getAuth() as $security) { + /** @var \Appwrite\SDK\AuthType $security */ + if (array_key_exists($security->value, $this->keys)) { + $securities[$security->value] = []; } } @@ -275,7 +288,7 @@ class Swagger2 extends Format $parameters = \array_merge( $route->getParams(), - $route->getLabel('sdk.parameters', []), + $sdk->getParameters() ?? [], ); foreach ($parameters as $name => $param) { // Set params @@ -325,7 +338,7 @@ class Swagger2 extends Format $node['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($route->getLabel('sdk.methodType', '') === 'upload') { + if ($sdk->getMethodType() === MethodType::UPLOAD) { $node['x-upload-id'] = true; } $node['type'] = $validator->getType(); @@ -432,7 +445,7 @@ class Swagger2 extends Format //Iterate the blackList. If it matches with the current one, then it is blackListed $allowed = true; foreach ($this->enumBlacklist as $blacklist) { - if ($blacklist['namespace'] == $route->getLabel('sdk.namespace', '') && $blacklist['method'] == $method && $blacklist['parameter'] == $name) { + if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $method && $blacklist['parameter'] == $name) { $allowed = false; break; } @@ -440,8 +453,8 @@ class Swagger2 extends Format if ($allowed && $validator->getType() === 'string') { $node['enum'] = $validator->getList(); - $node['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name); - $node['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name); + $node['x-enum-name'] = $this->getEnumName($namespace, $method, $name); + $node['x-enum-keys'] = $this->getEnumKeys($namespace, $method, $name); } if ($validator->getType() === 'integer') { From 67a72edebfa6548ab4bb115dccf26412df62e274 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 16 Dec 2024 15:03:57 +0900 Subject: [PATCH 05/29] Run Linter --- app/controllers/api/account.php | 2 +- app/controllers/api/functions.php | 9 ++++++--- app/controllers/api/messaging.php | 1 - src/Appwrite/SDK/Method.php | 22 ++++++++++++---------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 1b8c3ac30e..585f1bcecb 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -3808,7 +3808,7 @@ App::post('/v1/account/mfa/authenticators/:type') responseModel: Response::MODEL_MFA_TYPE, offlineModel: '/account', offlineKey: 'current' - )) + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') ->inject('response') diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 1d485538ee..82ac617e79 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1688,7 +1688,7 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build') ->label('scope', 'functions.write') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'deployment.update') - ->label('audits.resource', 'function/{request.functionId}') + ->label('audits.resource', 'function/{request.functionId}') ->label('sdk', new Method( namespace: 'functions', name: 'updateDeploymentBuild', @@ -2464,7 +2464,8 @@ App::get('/v1/functions/:functionId/variables') ->desc('List variables') ->groups(['api', 'functions']) ->label('scope', 'functions.read') - ->label('sdk', + ->label( + 'sdk', new Method( namespace: 'functions', name: 'listVariables', @@ -2496,7 +2497,9 @@ App::get('/v1/functions/:functionId/variables/:variableId') ->groups(['api', 'functions']) ->label('scope', 'functions.read') ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) - ->label('sdk', new Method( + ->label( + 'sdk', + new Method( namespace: 'functions', name: 'getVariable', description: '/docs/references/functions/get-variable.md', diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index fbeb38e355..54d8a7577e 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -23,7 +23,6 @@ use Appwrite\Utopia\Database\Validator\Queries\Targets; use Appwrite\Utopia\Database\Validator\Queries\Topics; use Appwrite\Utopia\Response; use MaxMind\Db\Reader; -use Tests\Unit\Auth\AuthTest; use Utopia\App; use Utopia\Audit\Audit; use Utopia\Database\Database; diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 0ae9451b6c..4f0c4f9725 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -5,21 +5,24 @@ namespace Appwrite\SDK; use Appwrite\Utopia\Response; use Swoole\Http\Response as HttpResponse; -enum AuthType: string { +enum AuthType: string +{ case JWT = APP_AUTH_TYPE_JWT; case KEY = APP_AUTH_TYPE_KEY; case SESSION = APP_AUTH_TYPE_SESSION; case ADMIN = APP_AUTH_TYPE_ADMIN; } -enum MethodType: string { +enum MethodType: string +{ case WEBAUTH = 'webAuth'; case LOCATION = 'location'; case GRAPHQL = 'graphql'; case UPLOAD = 'upload'; } -enum ResponseType: string { +enum ResponseType: string +{ case NONE = ''; case JSON = 'application/json'; case IMAGE = 'image/*'; @@ -32,11 +35,11 @@ enum ResponseType: string { class Method { - static array $knownMethods = []; + public static array $knownMethods = []; /** * Initialise a new SDK method - * + * * @param array $authTypes * @param string $namespace * @param MethodType $methodType @@ -45,7 +48,7 @@ class Method * @param string $responseModel * @param string $offlineKey * @param string $offlineModel - * + * * @throws \Exception */ public function __construct( @@ -65,12 +68,11 @@ class Method protected bool $packaging = false, protected string $requestType = 'application/json', protected array $parameters = [], - ) - { + ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); // Disabled for now, will be enabled later - // $this->validateDesc($description); + // $this->validateDesc($description); $this->validateResponseModel($responseModel); // No content check @@ -219,4 +221,4 @@ class Method { return $this->parameters; } -} \ No newline at end of file +} From 2997a112742902e60aa9d6fdad2ad4dfa1e12725 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:27:00 +0900 Subject: [PATCH 06/29] Add SDK Multiplexing --- app/config/specs/open-api3-latest-client.json | 112 +++++++++++++++++ .../specs/open-api3-latest-console.json | 112 +++++++++++++++++ app/config/specs/open-api3-latest-server.json | 114 ++++++++++++++++++ app/config/specs/swagger2-latest-client.json | 111 +++++++++++++++++ app/config/specs/swagger2-latest-console.json | 111 +++++++++++++++++ app/config/specs/swagger2-latest-server.json | 113 +++++++++++++++++ app/controllers/api/databases.php | 58 +++++---- src/Appwrite/SDK/Method.php | 31 ++++- src/Appwrite/SDK/Multiplex.php | 20 +++ .../Specification/Format/OpenAPI3.php | 5 +- 10 files changed, 748 insertions(+), 39 deletions(-) create mode 100644 src/Appwrite/SDK/Multiplex.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 7de634f988..d4dd2885a2 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4524,6 +4524,118 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create 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.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "multiplex": "[{},{}]", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index b27f65f130..a81b5e9c71 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8093,6 +8093,118 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create 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.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "multiplex": "[{},{}]", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index a772d5984f..f8672f22c7 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7627,6 +7627,120 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create 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.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "multiplex": "[{},{}]", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 9c8da35b7c..838296291a 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4710,6 +4710,117 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create 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.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index aba7d5c4b2..88a1aaab57 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8294,6 +8294,117 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create 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.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 26d911ca12..5edf0a39c1 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7806,6 +7806,119 @@ } ] }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create 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.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", + "offline-key": "{documentId}", + "offline-response-key": "$id", + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON object.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, "patch": { "summary": "Update documents", "operationId": "databasesUpdateDocuments", diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index cf5997619a..e5b8c47fc5 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -9,6 +9,7 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; +use Appwrite\SDK\Multiplex; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; @@ -2944,37 +2945,32 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - //TODO: Deal with SDK Multiplexing later - B/S - ->label('sdk.method', [ - 'createDocument' => [ - 'name' => 'Create Document', - 'parameters' => [ - 'documentId', - 'data', - 'permissions', - ], - 'required' => ['documentId', 'data'], - 'response' => Response::MODEL_DOCUMENT, - 'description' => '/docs/references/databases/create-document.md', - ], - 'createDocuments' => [ - 'name' => 'Create Documents', - 'parameters' => [ - 'documents' - ], - 'required' => ['documents'], - 'response' => Response::MODEL_DOCUMENT_LIST, - 'description' => '/docs/references/databases/create-documents.md' - ], - ]) - ->label('sdk.description', '/docs/references/databases/create-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', [Response::MODEL_DOCUMENT, Response::MODEL_DOCUMENT_LIST]) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', + new Method( + namespace: 'databases', + name: 'createDocument', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responseCode: Response::STATUS_CODE_CREATED, + responseModel: Response::MODEL_DOCUMENT, + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + multiplex: [ + new Multiplex( + name: 'createDocument', + parameters: ['documentId', 'data', 'permissions'], + required: ['documentId', 'data'], + responseModel: Response::MODEL_DOCUMENT, + ), + new Multiplex( + name: 'createDocuments', + parameters: ['documents'], + required: ['documents'], + responseModel: Response::MODEL_DOCUMENT_LIST, + ), + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 4f0c4f9725..79cf01cefb 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -37,17 +37,30 @@ class Method { public static array $knownMethods = []; + /** + * @var array + */ + protected array $multiplexRoutes = []; + /** * Initialise a new SDK method * - * @param array $authTypes * @param string $namespace - * @param MethodType $methodType - * @param string $desc + * @param string $name + * @param string $description + * @param array $auth * @param int $responseCode - * @param string $responseModel - * @param string $offlineKey - * @param string $offlineModel + * @param string|array $responseModel + * @param ResponseType $responseType + * @param MethodType|null $methodType + * @param string|null $offlineKey + * @param string|null $offlineModel + * @param string|null $offlineResponseKey + * @param bool $deprecated + * @param array|bool $hide + * @param bool $packaging + * @param string $requestType + * @param array $parameters * * @throws \Exception */ @@ -68,6 +81,7 @@ class Method protected bool $packaging = false, protected string $requestType = 'application/json', protected array $parameters = [], + protected array $multiplex = [] ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); @@ -221,4 +235,9 @@ class Method { return $this->parameters; } + + public function getMultiplex(): array + { + return $this->multiplex; + } } diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php new file mode 100644 index 0000000000..28754a53ea --- /dev/null +++ b/src/Appwrite/SDK/Multiplex.php @@ -0,0 +1,20 @@ + $parameters + * @param array $required + * @param string $responseModel + */ + function __construct( + private string $name, + private array $parameters, + private array $required, + private string $responseModel + ) + {} +} \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index d18f1e9120..3cc2ff1698 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -4,6 +4,7 @@ namespace Appwrite\Specification\Format; use Appwrite\SDK\AuthType; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Multiplex; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -196,8 +197,8 @@ class OpenAPI3 extends Format ], ]; - if (is_array($sdk->getMethodName() ?? '')) { - $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); + if (!empty($sdk->getMultiplex())) { + $temp['x-appwrite']['multiplex'] = \json_encode($sdk->getMultiplex()); } foreach ($this->models as $value) { From 8ae462c3172e780fbc43202d1728353fbd061614 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:31:26 +0900 Subject: [PATCH 07/29] Fix JSON Encode for multiplex objects --- app/config/specs/open-api3-latest-client.json | 26 ++++++++++++++++++- .../specs/open-api3-latest-console.json | 26 ++++++++++++++++++- app/config/specs/open-api3-latest-server.json | 26 ++++++++++++++++++- app/config/specs/swagger2-latest-client.json | 25 ++++++++++++++++++ app/config/specs/swagger2-latest-console.json | 25 ++++++++++++++++++ app/config/specs/swagger2-latest-server.json | 25 ++++++++++++++++++ src/Appwrite/SDK/Multiplex.php | 14 +++++++++- .../Specification/Format/OpenAPI3.php | 2 +- .../Specification/Format/Swagger2.php | 4 +-- 9 files changed, 166 insertions(+), 7 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index d4dd2885a2..b707348b2b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4564,7 +4564,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": "[{},{}]", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a81b5e9c71..a98367ab24 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8133,7 +8133,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": "[{},{}]", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index f8672f22c7..c50c1568be 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7667,7 +7667,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": "[{},{}]", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [], "Session": [] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 838296291a..15524e447b 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4752,6 +4752,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 88a1aaab57..6a2c058134 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8336,6 +8336,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 5edf0a39c1..a02fcb4347 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7848,6 +7848,31 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", + "multiplex": [ + { + "name": "createDocument", + "parameters": [ + "documentId", + "data", + "permissions" + ], + "required": [ + "documentId", + "data" + ], + "responseModel": "document" + }, + { + "name": "createDocuments", + "parameters": [ + "documents" + ], + "required": [ + "documents" + ], + "responseModel": "documentList" + } + ], "auth": { "Project": [], "Session": [] diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php index 28754a53ea..d05c940b75 100644 --- a/src/Appwrite/SDK/Multiplex.php +++ b/src/Appwrite/SDK/Multiplex.php @@ -2,7 +2,9 @@ namespace Appwrite\SDK; -class Multiplex +use JsonSerializable; + +class Multiplex implements JsonSerializable { /** * @param string $name @@ -17,4 +19,14 @@ class Multiplex private string $responseModel ) {} + + public function jsonSerialize(): array + { + return [ + 'name' => $this->name, + 'parameters' => $this->parameters, + 'required' => $this->required, + 'responseModel' => $this->responseModel, + ]; + } } \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 3cc2ff1698..450594b253 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -198,7 +198,7 @@ class OpenAPI3 extends Format ]; if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = \json_encode($sdk->getMultiplex()); + $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); } foreach ($this->models as $value) { diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 2595e59f50..5d6bc3a61a 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -198,8 +198,8 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } - if (is_array($sdk->getMethodName() ?? '')) { - $temp['x-appwrite']['multiplex'] = $sdk->getMethodName(); + if (!empty($sdk->getMultiplex())) { + $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); } foreach ($this->models as $value) { From 1361dbdec5a758dc6484465a1248b11347227bef Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:33:02 +0900 Subject: [PATCH 08/29] Remove get version API from SDKs --- app/controllers/api/health.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 379afd34fc..aba80a18bc 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -54,15 +54,6 @@ App::get('/v1/health/version') ->desc('Get version') ->groups(['api', 'health']) ->label('scope', 'public') - ->label('sdk', new Method( - namespace: 'health', - name: 'getVersion', - description: '/docs/references/health/get-version.md', - auth: [], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_VERSION, - responseType: ResponseType::JSON - )) ->inject('response') ->action(function (Response $response) { $response->dynamic(new Document([ 'version' => APP_VERSION_STABLE ]), Response::MODEL_HEALTH_VERSION); From fa053e493a51f920353352a676f18e4527f442ec Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:33:08 +0900 Subject: [PATCH 09/29] Update specs --- app/config/specs/open-api3-latest-client.json | 65 ------------------ .../specs/open-api3-latest-console.json | 65 ------------------ app/config/specs/open-api3-latest-server.json | 65 ------------------ app/config/specs/swagger2-latest-client.json | 67 ------------------- app/config/specs/swagger2-latest-console.json | 67 ------------------- app/config/specs/swagger2-latest-server.json | 67 ------------------- 6 files changed, 396 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index b707348b2b..ff4a9751f6 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -5533,57 +5533,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthVersion" - } - } - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -9878,20 +9827,6 @@ "countryName" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a98367ab24..2b84f19b25 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -13442,57 +13442,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthVersion" - } - } - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -37222,20 +37171,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index c50c1568be..e40dc58cd5 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -12291,57 +12291,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthVersion" - } - } - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -26851,20 +26800,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 15524e447b..d8e02126fe 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -5749,59 +5749,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "schema": { - "$ref": "#\/definitions\/healthVersion" - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -10086,20 +10033,6 @@ "countryName" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 6a2c058134..cadb43ec28 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -13700,59 +13700,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "schema": { - "$ref": "#\/definitions\/healthVersion" - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -37837,20 +37784,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "metric": { "description": "Metric", "type": "object", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index a02fcb4347..6b4b7a3e5a 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -12548,59 +12548,6 @@ ] } }, - "\/health\/version": { - "get": { - "summary": "Get version", - "operationId": "healthGetVersion", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Get the version of Appwrite that this instance is currently running.", - "responses": { - "200": { - "description": "Health Version", - "schema": { - "$ref": "#\/definitions\/healthVersion" - } - } - }, - "x-appwrite": { - "method": "getVersion", - "weight": 128, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-version.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-version.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "public", - "platforms": [ - "server", - "client" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/locale": { "get": { "summary": "Get user locale", @@ -27408,20 +27355,6 @@ "diff" ] }, - "healthVersion": { - "description": "Health Version", - "type": "object", - "properties": { - "version": { - "type": "string", - "description": "Version of the Appwrite instance.", - "x-example": "0.11.0" - } - }, - "required": [ - "version" - ] - }, "headers": { "description": "Headers", "type": "object", From 64a957859e0e1a9172be17cf3d4c668804299308 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 17 Dec 2024 10:39:06 +0900 Subject: [PATCH 10/29] Run Linter --- app/controllers/api/databases.php | 6 ++++-- src/Appwrite/SDK/Multiplex.php | 8 ++++---- src/Appwrite/Specification/Format/OpenAPI3.php | 1 - 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index e5b8c47fc5..36b80d1760 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2945,7 +2945,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk', + ->label( + 'sdk', new Method( namespace: 'databases', name: 'createDocument', @@ -2970,7 +2971,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') responseModel: Response::MODEL_DOCUMENT_LIST, ), ] - )) + ) + ) ->param('databaseId', '', new UID(), 'Database ID.') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php index d05c940b75..946838f086 100644 --- a/src/Appwrite/SDK/Multiplex.php +++ b/src/Appwrite/SDK/Multiplex.php @@ -12,13 +12,13 @@ class Multiplex implements JsonSerializable * @param array $required * @param string $responseModel */ - function __construct( + public function __construct( private string $name, private array $parameters, private array $required, private string $responseModel - ) - {} + ) { + } public function jsonSerialize(): array { @@ -29,4 +29,4 @@ class Multiplex implements JsonSerializable 'responseModel' => $this->responseModel, ]; } -} \ No newline at end of file +} diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 450594b253..d4e53783a7 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -4,7 +4,6 @@ namespace Appwrite\Specification\Format; use Appwrite\SDK\AuthType; use Appwrite\SDK\MethodType; -use Appwrite\SDK\Multiplex; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; From 624c91816b8fd6b247d73049153ac3ac3e4a1039 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 20 Dec 2024 12:06:09 +0900 Subject: [PATCH 11/29] Begin work on SDKResponse refactor --- app/config/specs/open-api3-latest-client.json | 8 +++-- .../specs/open-api3-latest-console.json | 8 +++-- app/config/specs/open-api3-latest-server.json | 8 +++-- app/config/specs/swagger2-latest-client.json | 8 +++-- app/config/specs/swagger2-latest-console.json | 8 +++-- app/config/specs/swagger2-latest-server.json | 8 +++-- app/controllers/api/health.php | 25 ++++++++++---- src/Appwrite/SDK/Method.php | 6 ++-- src/Appwrite/SDK/Multiplex.php | 28 ++++++++++------ src/Appwrite/SDK/Response.php | 33 +++++++++++++++++++ .../Specification/Format/OpenAPI3.php | 12 ++++++- .../Specification/Format/Swagger2.php | 12 ++++++- 12 files changed, 131 insertions(+), 33 deletions(-) create mode 100644 src/Appwrite/SDK/Response.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index ff4a9751f6..cffba28434 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4576,7 +4576,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/components\/schemas\/document" + ] }, { "name": "createDocuments", @@ -4586,7 +4588,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/components\/schemas\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 2b84f19b25..a9afe4b0e1 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8145,7 +8145,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/components\/schemas\/document" + ] }, { "name": "createDocuments", @@ -8155,7 +8157,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/components\/schemas\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index e40dc58cd5..4960002943 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7679,7 +7679,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/components\/schemas\/document" + ] }, { "name": "createDocuments", @@ -7689,7 +7691,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/components\/schemas\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index d8e02126fe..2bb9cd265c 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4764,7 +4764,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/definitions\/document" + ] }, { "name": "createDocuments", @@ -4774,7 +4776,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/definitions\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index cadb43ec28..bde121a094 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8348,7 +8348,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/definitions\/document" + ] }, { "name": "createDocuments", @@ -8358,7 +8360,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/definitions\/documentList" + ] } ], "auth": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 6b4b7a3e5a..f51bba17cd 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7860,7 +7860,9 @@ "documentId", "data" ], - "responseModel": "document" + "responses": [ + "#\/definitions\/document" + ] }, { "name": "createDocuments", @@ -7870,7 +7872,9 @@ "required": [ "documents" ], - "responseModel": "documentList" + "responses": [ + "#\/definitions\/documentList" + ] } ], "auth": { diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index aba80a18bc..46f16d0273 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -5,6 +5,7 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; @@ -34,8 +35,12 @@ App::get('/v1/health') name: 'get', auth: [AuthType::KEY], description: '/docs/references/health/get.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -68,8 +73,12 @@ App::get('/v1/health/db') namespace: 'health', name: 'getDB', description: '/docs/references/health/get-db.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -124,8 +133,12 @@ App::get('/v1/health/cache') namespace: 'health', name: 'getCache', description: '/docs/references/health/get-cache.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 79cf01cefb..ce4c55c9d8 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -49,8 +49,9 @@ class Method * @param string $name * @param string $description * @param array $auth + * @param array $responses * @param int $responseCode - * @param string|array $responseModel + * @param string|array $responseModel * @param ResponseType $responseType * @param MethodType|null $methodType * @param string|null $offlineKey @@ -69,8 +70,7 @@ class Method protected string $name, protected string $description, protected array $auth, - protected int $responseCode, - protected string|array $responseModel, + protected array $responses, protected ResponseType $responseType = ResponseType::JSON, protected ?MethodType $methodType = null, protected ?string $offlineKey = null, diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php index 946838f086..4129169528 100644 --- a/src/Appwrite/SDK/Multiplex.php +++ b/src/Appwrite/SDK/Multiplex.php @@ -2,9 +2,7 @@ namespace Appwrite\SDK; -use JsonSerializable; - -class Multiplex implements JsonSerializable +class Multiplex { /** * @param string $name @@ -20,13 +18,23 @@ class Multiplex implements JsonSerializable ) { } - public function jsonSerialize(): array + public function getName(): string { - return [ - 'name' => $this->name, - 'parameters' => $this->parameters, - 'required' => $this->required, - 'responseModel' => $this->responseModel, - ]; + return $this->name; + } + + public function getParameters(): array + { + return $this->parameters; + } + + public function getRequired(): array + { + return $this->required; + } + + public function getResponseModel(): string + { + return $this->responseModel; } } diff --git a/src/Appwrite/SDK/Response.php b/src/Appwrite/SDK/Response.php new file mode 100644 index 0000000000..7b521549cb --- /dev/null +++ b/src/Appwrite/SDK/Response.php @@ -0,0 +1,33 @@ +code; + } + + public function getModel(): string + { + return $this->model; + } + + public function getDescription(): string + { + return $this->description; + } +} \ No newline at end of file diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index d4e53783a7..842c473e78 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -197,7 +197,17 @@ class OpenAPI3 extends Format ]; if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); + $temp['x-appwrite']['multiplex'] = []; + foreach ($sdk->getMultiplex() as $multiplex) { + /** @var \Appwrite\SDK\Multiplex $multiplex */ + + $temp['x-appwrite']['multiplex'][] = [ + 'name' => $multiplex->getName(), + 'parameters' => $multiplex->getParameters(), + 'required' => $multiplex->getRequired(), + 'responses' => ['#/components/schemas/' . $multiplex->getResponseModel()] + ]; + } } foreach ($this->models as $value) { diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 5d6bc3a61a..952064faaf 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -199,7 +199,17 @@ class Swagger2 extends Format } if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = $sdk->getMultiplex(); + $temp['x-appwrite']['multiplex'] = []; + foreach ($sdk->getMultiplex() as $multiplex) { + /** @var \Appwrite\SDK\Multiplex $multiplex */ + + $temp['x-appwrite']['multiplex'][] = [ + 'name' => $multiplex->getName(), + 'parameters' => $multiplex->getParameters(), + 'required' => $multiplex->getRequired(), + 'responses' => ["#/definitions/" . $multiplex->getResponseModel()] + ]; + } } foreach ($this->models as $value) { From 6a782ce373baac0637079a0bc592578e5c21cf9e Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 30 Dec 2024 11:32:40 +0000 Subject: [PATCH 12/29] Implement SDKResponse class --- app/controllers/api/account.php | 400 ++++++++++++---- app/controllers/api/avatars.php | 71 ++- app/controllers/api/console.php | 17 +- app/controllers/api/databases.php | 442 +++++++++++++----- app/controllers/api/functions.php | 246 +++++++--- app/controllers/api/graphql.php | 29 +- app/controllers/api/health.php | 160 +++++-- app/controllers/api/locale.php | 74 ++- app/controllers/api/messaging.php | 415 ++++++++++------ app/controllers/api/migrations.php | 155 +++--- app/controllers/api/project.php | 55 ++- app/controllers/api/projects.php | 416 +++++++++++------ app/controllers/api/proxy.php | 46 +- app/controllers/api/storage.php | 137 ++++-- app/controllers/api/teams.php | 127 +++-- app/controllers/api/users.php | 389 +++++++++------ app/controllers/api/vcs.php | 97 ++-- composer.lock | 212 +++++---- src/Appwrite/SDK/Method.php | 23 +- src/Appwrite/SDK/Response.php | 14 +- .../Specification/Format/OpenAPI3.php | 113 ++--- .../Specification/Format/Swagger2.php | 104 +++-- 22 files changed, 2503 insertions(+), 1239 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 585f1bcecb..283cf2d8ea 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -24,6 +24,7 @@ use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; @@ -288,8 +289,12 @@ App::post('/v1/account') name: 'create', description: '/docs/references/account/create.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -427,8 +432,12 @@ App::get('/v1/account') name: 'get', description: '/docs/references/account/get.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, offlineModel: '/account', offlineKey: 'current' @@ -454,8 +463,12 @@ App::delete('/v1/account') name: 'delete', description: '/docs/references/account/delete.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::JSON )) ->inject('user') @@ -502,8 +515,12 @@ App::get('/v1/account/sessions') name: 'listSessions', description: '/docs/references/account/list-sessions.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/account/sessions' )) @@ -548,8 +565,12 @@ App::delete('/v1/account/sessions') name: 'deleteSessions', description: '/docs/references/account/delete-sessions.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 100) @@ -613,8 +634,12 @@ App::get('/v1/account/sessions/:sessionId') name: 'getSession', description: '/docs/references/account/get-session.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON, offlineModel: '/account/sessions', offlineKey: '{sessionId}' @@ -664,8 +689,12 @@ App::delete('/v1/account/sessions/:sessionId') name: 'deleteSession', description: '/docs/references/account/delete-session.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 100) @@ -748,8 +777,12 @@ App::patch('/v1/account/sessions/:sessionId') name: 'updateSession', description: '/docs/references/account/update-session.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -828,8 +861,12 @@ App::post('/v1/account/sessions/email') name: 'createEmailPasswordSession', description: '/docs/references/account/create-session-email-password.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -964,8 +1001,12 @@ App::post('/v1/account/sessions/anonymous') name: 'createAnonymousSession', description: '/docs/references/account/create-session-anonymous.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 50) @@ -1103,8 +1144,12 @@ App::post('/v1/account/sessions/token') name: 'createSession', description: '/docs/references/account/create-session.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON )) ->label('abuse-limit', 10) @@ -1133,9 +1178,13 @@ App::get('/v1/account/sessions/oauth2/:provider') description: '/docs/references/account/create-session-oauth2.md', methodType: MethodType::WEBAUTH, auth: [], - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::HTML, - responseModel: Response::MODEL_NONE, hide: [APP_PLATFORM_SERVER], )) ->label('abuse-limit', 50) @@ -1725,9 +1774,13 @@ App::get('/v1/account/tokens/oauth2/:provider') name: 'createOAuth2Token', description: '/docs/references/account/create-token-oauth2.md', auth: [], - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::HTML, - responseModel: Response::MODEL_NONE, methodType: MethodType::WEBAUTH, )) ->label('abuse-limit', 50) @@ -1801,9 +1854,13 @@ App::post('/v1/account/tokens/magic-url') name: 'createMagicURLToken', description: '/docs/references/account/create-token-magic-url.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -2046,9 +2103,13 @@ App::post('/v1/account/tokens/email') name: 'createEmailToken', description: '/docs/references/account/create-token-email.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') @@ -2277,9 +2338,13 @@ App::put('/v1/account/sessions/magic-url') name: 'updateMagicURLSession', description: '/docs/references/account/create-session.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_SESSION, deprecated: true, )) ->label('abuse-limit', 10) @@ -2310,9 +2375,13 @@ App::put('/v1/account/sessions/phone') name: 'updatePhoneSession', description: '/docs/references/account/create-session.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_SESSION, deprecated: true, )) ->label('abuse-limit', 10) @@ -2344,9 +2413,13 @@ App::post('/v1/account/tokens/phone') name: 'createPhoneToken', description: '/docs/references/account/create-token-phone.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) @@ -2524,9 +2597,13 @@ App::post('/v1/account/jwts') name: 'createJWT', description: '/docs/references/account/create-jwt.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_JWT, )) ->label('abuse-limit', 100) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -2568,9 +2645,13 @@ App::get('/v1/account/prefs') name: 'getPrefs', description: '/docs/references/account/get-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_PREFERENCES, offlineModel: '/account/prefs', offlineKey: 'current', )) @@ -2592,9 +2673,13 @@ App::get('/v1/account/logs') name: 'listLogs', description: '/docs/references/account/list-logs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST, )) ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2662,9 +2747,13 @@ App::patch('/v1/account/name') name: 'updateName', description: '/docs/references/account/update-name.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2698,9 +2787,13 @@ App::patch('/v1/account/password') name: 'updatePassword', description: '/docs/references/account/update-password.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2769,9 +2862,13 @@ App::patch('/v1/account/email') name: 'updateEmail', description: '/docs/references/account/update-email.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2863,9 +2960,13 @@ App::patch('/v1/account/phone') name: 'updatePhone', description: '/docs/references/account/update-phone.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -2946,9 +3047,13 @@ App::patch('/v1/account/prefs') name: 'updatePrefs', description: '/docs/references/account/update-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account/prefs', offlineKey: 'current', )) @@ -2981,9 +3086,13 @@ App::patch('/v1/account/status') name: 'updateStatus', description: '/docs/references/account/update-status.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER )) ->inject('requestTimestamp') ->inject('request') @@ -3027,9 +3136,13 @@ App::post('/v1/account/recovery') name: 'createRecovery', description: '/docs/references/account/create-recovery.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -3209,9 +3322,13 @@ App::put('/v1/account/recovery') name: 'updateRecovery', description: '/docs/references/account/update-recovery.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3295,9 +3412,13 @@ App::post('/v1/account/verification') name: 'createVerification', description: '/docs/references/account/create-email-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -3462,9 +3583,13 @@ App::put('/v1/account/verification') name: 'updateVerification', description: '/docs/references/account/update-email-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3524,9 +3649,13 @@ App::post('/v1/account/verification/phone') name: 'createPhoneVerification', description: '/docs/references/account/create-phone-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},userId:{userId}', 'url:{url},ip:{ip}']) @@ -3653,9 +3782,13 @@ App::put('/v1/account/verification/phone') name: 'updatePhoneVerification', description: '/docs/references/account/update-phone-verification.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOKEN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'userId:{param-userId}') @@ -3714,9 +3847,13 @@ App::patch('/v1/account/mfa') name: 'updateMFA', description: '/docs/references/account/update-mfa.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current', )) @@ -3765,9 +3902,13 @@ App::get('/v1/account/mfa/factors') name: 'listMfaFactors', description: '/docs/references/account/list-mfa-factors.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_FACTORS, offlineKey: 'current', offlineModel: '/account' )) @@ -3803,9 +3944,13 @@ App::post('/v1/account/mfa/authenticators/:type') name: 'createMfaAuthenticator', description: '/docs/references/account/create-mfa-authenticator.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_TYPE, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_TYPE, offlineModel: '/account', offlineKey: 'current' )) @@ -3877,9 +4022,13 @@ App::put('/v1/account/mfa/authenticators/:type') name: 'updateMfaAuthenticator', description: '/docs/references/account/update-mfa-authenticator.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_USER, offlineModel: '/account', offlineKey: 'current' )) @@ -3944,9 +4093,13 @@ App::post('/v1/account/mfa/recovery-codes') name: 'createMfaRecoveryCodes', description: '/docs/references/account/create-mfa-recovery-codes.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, offlineModel: '/account', offlineKey: 'current', )) @@ -3988,9 +4141,13 @@ App::patch('/v1/account/mfa/recovery-codes') name: 'updateMfaRecoveryCodes', description: '/docs/references/account/update-mfa-recovery-codes.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, offlineModel: '/account', offlineKey: 'current', )) @@ -4027,9 +4184,13 @@ App::get('/v1/account/mfa/recovery-codes') name: 'getMfaRecoveryCodes', description: '/docs/references/account/get-mfa-recovery-codes.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, offlineModel: '/account', offlineKey: 'current', )) @@ -4063,8 +4224,13 @@ App::delete('/v1/account/mfa/authenticators/:type') name: 'deleteMfaAuthenticator', description: '/docs/references/account/delete-mfa-authenticator.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -4103,9 +4269,13 @@ App::post('/v1/account/mfa/challenge') name: 'createMfaChallenge', description: '/docs/references/account/create-mfa-challenge.md', auth: [], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_CHALLENGE, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_MFA_CHALLENGE, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -4293,9 +4463,13 @@ App::put('/v1/account/mfa/challenge') name: 'updateMfaChallenge', description: '/docs/references/account/update-mfa-challenge.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SESSION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') @@ -4382,9 +4556,13 @@ App::post('/v1/account/targets/push') name: 'createPushTarget', description: '/docs/references/account/create-push-target.md', auth: [AuthType::SESSION], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TARGET, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TARGET, + ) + ], + responseType: ResponseType::JSON )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4458,9 +4636,13 @@ App::put('/v1/account/targets/:targetId/push') name: 'updatePushTarget', description: '/docs/references/account/update-push-target.md', auth: [AuthType::SESSION], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TARGET, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ], + responseType: ResponseType::JSON )) ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4518,8 +4700,13 @@ App::delete('/v1/account/targets/:targetId/push') name: 'deletePushTarget', description: '/docs/references/account/delete-push-target.md', auth: [AuthType::SESSION], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -4563,9 +4750,13 @@ App::get('/v1/account/identities') name: 'listIdentities', description: '/docs/references/account/list-identities.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_IDENTITY_LIST, + ) + ], responseType: ResponseType::JSON, - responseModel: Response::MODEL_IDENTITY_LIST, offlineModel: '/account/identities', )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) @@ -4631,8 +4822,13 @@ App::delete('/v1/account/identities/:identityId') name: 'deleteIdentity', description: '/docs/references/account/delete-identity.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 001ae09b94..e06b8c9ff1 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -4,6 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; @@ -174,9 +175,13 @@ App::get('/v1/avatars/credit-cards/:code') description: '/docs/references/avatars/get-credit-card.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -197,9 +202,13 @@ App::get('/v1/avatars/browsers/:code') description: '/docs/references/avatars/get-browser.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -220,9 +229,13 @@ App::get('/v1/avatars/flags/:code') description: '/docs/references/avatars/get-flag.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -243,9 +256,13 @@ App::get('/v1/avatars/image') description: '/docs/references/avatars/get-image.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) @@ -309,9 +326,13 @@ App::get('/v1/avatars/favicon') description: '/docs/references/avatars/get-favicon.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.') ->inject('response') @@ -455,9 +476,13 @@ App::get('/v1/avatars/qr') description: '/docs/references/avatars/get-qr.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) @@ -499,9 +524,13 @@ App::get('/v1/avatars/initials') description: '/docs/references/avatars/get-initials.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], methodType: MethodType::LOCATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE_PNG, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::IMAGE_PNG )) ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 0ed74b8625..1d5cc085d6 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -3,6 +3,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; @@ -29,8 +30,12 @@ App::get('/v1/console/variables') name: 'variables', description: '/docs/references/console/variables.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_CONSOLE_VARIABLES, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CONSOLE_VARIABLES, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -70,8 +75,12 @@ App::post('/v1/console/assistant') name: 'chat', description: '/docs/references/assistant/chat.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::TEXT )) ->label('abuse-limit', 15) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 36b80d1760..5c7479ffac 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -10,6 +10,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Multiplex; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; @@ -457,8 +458,12 @@ App::post('/v1/databases') name: 'create', description: '/docs/references/databases/create.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DATABASE, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -535,8 +540,12 @@ App::get('/v1/databases') name: 'list', description: '/docs/references/databases/list.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DATABASE_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) @@ -593,8 +602,12 @@ App::get('/v1/databases/:databaseId') name: 'get', description: '/docs/references/databases/get.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -621,8 +634,12 @@ App::get('/v1/databases/:databaseId/logs') name: 'listLogs', description: '/docs/references/databases/get-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -718,8 +735,12 @@ App::put('/v1/databases/:databaseId') name: 'update', description: '/docs/references/databases/update.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -759,8 +780,13 @@ App::delete('/v1/databases/:databaseId') name: 'delete', description: '/docs/references/databases/delete.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -810,8 +836,12 @@ App::post('/v1/databases/:databaseId/collections') name: 'createCollection', description: '/docs/references/databases/create-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_COLLECTION, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -877,8 +907,12 @@ App::get('/v1/databases/:databaseId/collections') name: 'listCollections', description: '/docs/references/databases/list-collections.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COLLECTION_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -945,8 +979,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') name: 'getCollection', description: '/docs/references/databases/get-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -982,8 +1020,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') name: 'listCollectionLogs', description: '/docs/references/databases/get-collection-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -1083,8 +1125,12 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') name: 'updateCollection', description: '/docs/references/databases/update-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -1153,8 +1199,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') name: 'deleteCollection', description: '/docs/references/databases/delete-collection.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1211,9 +1262,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string name: 'createStringAttribute', description: '/docs/references/databases/create-string-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_STRING, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_STRING + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1270,9 +1324,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email' name: 'createEmailAttribute', description: '/docs/references/databases/create-email-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_EMAIL, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_EMAIL, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1315,9 +1372,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') name: 'createEnumAttribute', description: '/docs/references/databases/create-attribute-enum.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_ENUM, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_ENUM, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1365,9 +1425,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') name: 'createIpAttribute', description: '/docs/references/databases/create-ip-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_IP, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_IP, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1410,9 +1473,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') name: 'createUrlAttribute', description: '/docs/references/databases/create-url-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_URL, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_URL, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1455,9 +1521,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege name: 'createIntegerAttribute', description: '/docs/references/databases/create-integer-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_INTEGER, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_INTEGER, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1529,9 +1598,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float' name: 'createFloatAttribute', description: '/docs/references/databases/create-float-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_FLOAT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_FLOAT, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1601,9 +1673,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea name: 'createBooleanAttribute', description: '/docs/references/databases/create-boolean-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_BOOLEAN, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1645,9 +1720,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti name: 'createDatetimeAttribute', description: '/docs/references/databases/create-datetime-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_DATETIME, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_DATETIME, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1692,9 +1770,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati name: 'createRelationshipAttribute', description: '/docs/references/databases/create-relationship-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1820,9 +1901,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') name: 'listAttributes', description: '/docs/references/databases/list-attributes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_LIST + ) + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1903,20 +1987,23 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') name: 'getAttribute', description: '/docs/references/databases/get-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: [ - Response::MODEL_ATTRIBUTE_BOOLEAN, - Response::MODEL_ATTRIBUTE_INTEGER, - Response::MODEL_ATTRIBUTE_FLOAT, - Response::MODEL_ATTRIBUTE_EMAIL, - Response::MODEL_ATTRIBUTE_ENUM, - Response::MODEL_ATTRIBUTE_URL, - Response::MODEL_ATTRIBUTE_IP, - Response::MODEL_ATTRIBUTE_DATETIME, - Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Response::MODEL_ATTRIBUTE_STRING - ], - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: [ + Response::MODEL_ATTRIBUTE_BOOLEAN, + Response::MODEL_ATTRIBUTE_INTEGER, + Response::MODEL_ATTRIBUTE_FLOAT, + Response::MODEL_ATTRIBUTE_EMAIL, + Response::MODEL_ATTRIBUTE_ENUM, + Response::MODEL_ATTRIBUTE_URL, + Response::MODEL_ATTRIBUTE_IP, + Response::MODEL_ATTRIBUTE_DATETIME, + Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_STRING + ] + ), + ] )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1984,8 +2071,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin name: 'updateStringAttribute', description: '/docs/references/databases/update-string-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_STRING, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_STRING, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2031,8 +2122,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email name: 'updateEmailAttribute', description: '/docs/references/databases/update-email-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_EMAIL, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_EMAIL, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2076,8 +2171,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/ name: 'updateEnumAttribute', description: '/docs/references/databases/update-enum-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_ENUM, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_ENUM, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2123,8 +2222,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k name: 'updateIpAttribute', description: '/docs/references/databases/update-ip-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_IP, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_IP, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2168,8 +2271,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/: name: 'updateUrlAttribute', description: '/docs/references/databases/update-url-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_URL, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_URL, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2213,8 +2320,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ name: 'updateIntegerAttribute', description: '/docs/references/databases/update-integer-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_INTEGER, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_INTEGER, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2268,8 +2379,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float name: 'updateFloatAttribute', description: '/docs/references/databases/update-float-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_FLOAT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_FLOAT, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2323,8 +2438,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole name: 'updateBooleanAttribute', description: '/docs/references/databases/update-boolean-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_BOOLEAN, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_BOOLEAN, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2367,8 +2486,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet name: 'updateDatetimeAttribute', description: '/docs/references/databases/update-datetime-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_DATETIME, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_DATETIME, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2411,8 +2534,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ name: 'updateRelationshipAttribute', description: '/docs/references/databases/update-relationship-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2472,8 +2599,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key name: 'deleteAttribute', description: '/docs/references/databases/delete-attribute.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2588,8 +2720,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') name: 'createIndex', description: '/docs/references/databases/create-index.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_INDEX, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_INDEX, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2758,8 +2894,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') name: 'listIndexes', description: '/docs/references/databases/list-indexes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_INDEX_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INDEX_LIST, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2836,8 +2976,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') name: 'getIndex', description: '/docs/references/databases/get-index.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_INDEX, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INDEX, + ) + ], responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -2881,8 +3025,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') name: 'deleteIndex', description: '/docs/references/databases/delete-index.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2952,8 +3101,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'createDocument', description: '/docs/references/databases/create-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_DOCUMENT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], responseType: ResponseType::JSON, offlineKey: '{documentId}', offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', @@ -3260,8 +3413,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'listDocuments', description: '/docs/references/databases/list-documents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', )) @@ -3417,8 +3574,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen name: 'getDocument', description: '/docs/references/databases/get-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' @@ -3512,8 +3673,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen name: 'listDocumentLogs', description: '/docs/references/databases/get-document-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], responseType: ResponseType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -3625,8 +3790,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum name: 'updateDocument', description: '/docs/references/databases/update-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' @@ -3864,8 +4033,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'updateDocuments', description: '/docs/references/databases/update-documents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', )) @@ -4003,8 +4176,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu name: 'deleteDocument', description: '/docs/references/databases/delete-document.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' )) @@ -4123,8 +4301,12 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') name: 'deleteDocuments', description: '/docs/references/databases/delete-documents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DOCUMENT_LIST, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], responseType: ResponseType::JSON, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' @@ -4229,9 +4411,13 @@ App::get('/v1/databases/usage') name: 'getUsage', description: '/docs/references/databases/get-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_DATABASES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_DATABASES, + ) + ], + responseType: ResponseType::JSON )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') @@ -4314,8 +4500,12 @@ App::get('/v1/databases/:databaseId/usage') name: 'getDatabaseUsage', description: '/docs/references/databases/get-database-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_DATABASE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_DATABASE, + ) + ], responseType: ResponseType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') @@ -4405,8 +4595,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') name: 'getCollectionUsage', description: '/docs/references/databases/get-collection-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_COLLECTION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_COLLECTION, + ) + ], responseType: ResponseType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 82ac617e79..8d79ecd40e 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -17,6 +17,7 @@ use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; @@ -150,9 +151,12 @@ App::post('/v1/functions') name: 'create', description: '/docs/references/functions/create-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_FUNCTION, + ) + ], )) ->param('functionId', '', new CustomId(), 'Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') @@ -413,9 +417,12 @@ App::get('/v1/functions') name: 'list', description: '/docs/references/functions/list-functions.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION_LIST, + ) + ] )) ->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -476,9 +483,12 @@ App::get('/v1/functions/runtimes') name: 'listRuntimes', description: '/docs/references/functions/list-runtimes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_RUNTIME_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_RUNTIME_LIST, + ) + ] )) ->inject('response') ->action(function (Response $response) { @@ -512,9 +522,12 @@ App::get('/v1/functions/specifications') name: 'listSpecifications', description: '/docs/references/functions/list-specifications.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SPECIFICATION_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SPECIFICATION_LIST, + ) + ] )) ->inject('response') ->inject('plan') @@ -551,9 +564,12 @@ App::get('/v1/functions/:functionId') name: 'get', description: '/docs/references/functions/get-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -578,9 +594,12 @@ App::get('/v1/functions/:functionId/usage') name: 'getFunctionUsage', description: '/docs/references/functions/get-function-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) @@ -686,9 +705,12 @@ App::get('/v1/functions/usage') name: 'getUsage', description: '/docs/references/functions/get-functions-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_FUNCTIONS, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_FUNCTIONS, + ) + ] )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') @@ -792,9 +814,12 @@ App::put('/v1/functions/:functionId') name: 'update', description: '/docs/references/functions/update-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') @@ -994,8 +1019,12 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') name: 'getDeploymentDownload', description: '/docs/references/functions/get-deployment-download.md', auth: [AuthType::KEY, AuthType::JWT], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_OK, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::ANY, methodType: MethodType::LOCATION )) @@ -1086,9 +1115,12 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId') name: 'updateDeployment', description: '/docs/references/functions/update-function-deployment.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FUNCTION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1151,8 +1183,12 @@ App::delete('/v1/functions/:functionId') name: 'delete', description: '/docs/references/functions/delete-function.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -1201,10 +1237,13 @@ App::post('/v1/functions/:functionId/deployments') name: 'createDeployment', description: '/docs/references/functions/create-deployment.md', auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_DEPLOYMENT, + ) + ], requestType: 'multipart/form-data', - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_DEPLOYMENT, - responseType: ResponseType::JSON, methodType: MethodType::UPLOAD, packaging: true, )) @@ -1420,9 +1459,12 @@ App::get('/v1/functions/:functionId/deployments') name: 'listDeployments', description: '/docs/references/functions/list-deployments.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DEPLOYMENT_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DEPLOYMENT_LIST, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true) @@ -1506,9 +1548,12 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId') name: 'getDeployment', description: '/docs/references/functions/get-deployment.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_DEPLOYMENT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DEPLOYMENT, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1555,8 +1600,12 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') name: 'deleteDeployment', description: '/docs/references/functions/delete-deployment.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1623,8 +1672,12 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/build') name: 'createBuild', description: '/docs/references/functions/create-deployment-build.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1694,9 +1747,12 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build') name: 'updateDeploymentBuild', description: '/docs/references/functions/update-deployment-build.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUILD, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUILD, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1786,9 +1842,13 @@ App::post('/v1/functions/:functionId/executions') name: 'createExecution', description: '/docs/references/functions/create-execution.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_EXECUTION, + ) + ], responseType: ResponseType::MULTIPART, - responseModel: Response::MODEL_EXECUTION, requestType: 'application/json', )) ->param('functionId', '', new UID(), 'Function ID.') @@ -2190,9 +2250,12 @@ App::get('/v1/functions/:functionId/executions') name: 'listExecutions', description: '/docs/references/functions/list-executions.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_EXECUTION_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EXECUTION_LIST, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) @@ -2280,9 +2343,12 @@ App::get('/v1/functions/:functionId/executions/:executionId') name: 'getExecution', description: '/docs/references/functions/get-execution.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_EXECUTION + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EXECUTION, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2333,8 +2399,12 @@ App::delete('/v1/functions/:functionId/executions/:executionId') name: 'deleteExecution', description: '/docs/references/functions/delete-execution.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2405,9 +2475,12 @@ App::post('/v1/functions/:functionId/variables') name: 'createVariable', description: '/docs/references/functions/create-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) @@ -2471,9 +2544,12 @@ App::get('/v1/functions/:functionId/variables') name: 'listVariables', description: '/docs/references/functions/list-variables.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE_LIST, + ) + ], ) ) ->param('functionId', '', new UID(), 'Function unique ID.', false) @@ -2504,9 +2580,12 @@ App::get('/v1/functions/:functionId/variables/:variableId') name: 'getVariable', description: '/docs/references/functions/get-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ], ) ) ->param('functionId', '', new UID(), 'Function unique ID.', false) @@ -2549,9 +2628,12 @@ App::put('/v1/functions/:functionId/variables/:variableId') name: 'updateVariable', description: '/docs/references/functions/update-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_VARIABLE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) @@ -2613,8 +2695,12 @@ App::delete('/v1/functions/:functionId/variables/:variableId') name: 'deleteVariable', description: '/docs/references/functions/delete-variable.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) @@ -2662,9 +2748,12 @@ App::get('/v1/functions/templates') name: 'listTemplates', description: '/docs/references/functions/list-templates.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TEMPLATE_FUNCTION_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEMPLATE_FUNCTION_LIST, + ) + ] )) ->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true) ->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of use cases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' use cases are allowed.', true) @@ -2702,9 +2791,12 @@ App::get('/v1/functions/templates/:templateId') name: 'getTemplate', description: '/docs/references/functions/get-template.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TEMPLATE_FUNCTION + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEMPLATE_FUNCTION, + ) + ] )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 6d34a8c70a..1f4e4e334a 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -8,7 +8,7 @@ use Appwrite\GraphQL\Schema; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use GraphQL\Error\DebugFlag; @@ -48,9 +48,12 @@ App::get('/v1/graphql') auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], hide: true, description: '/docs/references/graphql/get.md', - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_ANY + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ] )) ->label('abuse-limit', 60) ->label('abuse-time', 60) @@ -90,9 +93,12 @@ App::post('/v1/graphql/mutation') name: 'mutation', auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], description: '/docs/references/graphql/post.md', - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_ANY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ], methodType: MethodType::GRAPHQL, parameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], @@ -137,9 +143,12 @@ App::post('/v1/graphql') name: 'query', auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], description: '/docs/references/graphql/post.md', - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_ANY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ], methodType: MethodType::GRAPHQL, parameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 46f16d0273..baa737ce1e 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -197,8 +197,12 @@ App::get('/v1/health/queue') namespace: 'health', name: 'getQueue', description: '/docs/references/health/get-queue.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -256,8 +260,12 @@ App::get('/v1/health/pubsub') namespace: 'health', name: 'getPubSub', description: '/docs/references/health/get-pubsub.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -316,8 +324,12 @@ App::get('/v1/health/time') namespace: 'health', name: 'getTime', description: '/docs/references/health/get-time.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_TIME, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_TIME, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -375,8 +387,12 @@ App::get('/v1/health/queue/webhooks') namespace: 'health', name: 'getQueueWebhooks', description: '/docs/references/health/get-queue-webhooks.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -404,8 +420,12 @@ App::get('/v1/health/queue/logs') namespace: 'health', name: 'getQueueLogs', description: '/docs/references/health/get-queue-logs.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -433,8 +453,12 @@ App::get('/v1/health/certificate') namespace: 'health', name: 'getCertificate', description: '/docs/references/health/get-certificate.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_CERTIFICATE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_CERTIFICATE, + ) + ], responseType: ResponseType::JSON )) ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') @@ -485,8 +509,12 @@ App::get('/v1/health/queue/certificates') namespace: 'health', name: 'getQueueCertificates', description: '/docs/references/health/get-queue-certificates.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -514,8 +542,12 @@ App::get('/v1/health/queue/builds') namespace: 'health', name: 'getQueueBuilds', description: '/docs/references/health/get-queue-builds.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -543,8 +575,12 @@ App::get('/v1/health/queue/databases') namespace: 'health', name: 'getQueueDatabases', description: '/docs/references/health/get-queue-databases.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) @@ -573,8 +609,12 @@ App::get('/v1/health/queue/deletes') namespace: 'health', name: 'getQueueDeletes', description: '/docs/references/health/get-queue-deletes.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -602,8 +642,12 @@ App::get('/v1/health/queue/mails') namespace: 'health', name: 'getQueueMails', description: '/docs/references/health/get-queue-mails.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -631,8 +675,12 @@ App::get('/v1/health/queue/messaging') namespace: 'health', name: 'getQueueMessaging', description: '/docs/references/health/get-queue-messaging.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -660,8 +708,12 @@ App::get('/v1/health/queue/migrations') namespace: 'health', name: 'getQueueMigrations', description: '/docs/references/health/get-queue-migrations.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -689,8 +741,12 @@ App::get('/v1/health/queue/functions') namespace: 'health', name: 'getQueueFunctions', description: '/docs/references/health/get-queue-functions.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -718,8 +774,12 @@ App::get('/v1/health/queue/usage') namespace: 'health', name: 'getQueueUsage', description: '/docs/references/health/get-queue-usage.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -747,8 +807,12 @@ App::get('/v1/health/queue/usage-dump') namespace: 'health', name: 'getQueueUsageDump', description: '/docs/references/health/get-queue-usage-dump.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -776,8 +840,12 @@ App::get('/v1/health/storage/local') namespace: 'health', name: 'getStorageLocal', description: '/docs/references/health/get-storage-local.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -821,8 +889,12 @@ App::get('/v1/health/storage') namespace: 'health', name: 'getStorage', description: '/docs/references/health/get-storage.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_STATUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -864,8 +936,12 @@ App::get('/v1/health/anti-virus') namespace: 'health', name: 'getAntivirus', description: '/docs/references/health/get-storage-anti-virus.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_ANTIVIRUS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_ANTIVIRUS, + ) + ], responseType: ResponseType::JSON )) ->inject('response') @@ -905,8 +981,12 @@ App::get('/v1/health/queue/failed/:name') namespace: 'health', name: 'getFailedJobs', description: '/docs/references/health/get-failed-queue-jobs.md', - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_HEALTH_QUEUE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], responseType: ResponseType::JSON )) ->param('name', '', new WhiteList([ diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index c918d666a0..28defca386 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -2,7 +2,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use MaxMind\Db\Reader; @@ -20,9 +20,12 @@ App::get('/v1/locale') name: 'get', description: '/docs/references/locale/get-locale.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOCALE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOCALE, + ) + ], offlineKey: 'current', offlineModel: '/localed', )) @@ -82,9 +85,12 @@ App::get('/v1/locale/codes') name: 'listCodes', description: '/docs/references/locale/list-locale-codes.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOCALE_CODE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOCALE_CODE_LIST, + ) + ], offlineKey: 'current', offlineModel: '/locale/localeCode', )) @@ -106,9 +112,12 @@ App::get('/v1/locale/countries') name: 'listCountries', description: '/docs/references/locale/list-countries.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COUNTRY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COUNTRY_LIST, + ) + ], offlineModel: '/locale/countries', offlineResponseKey: 'code' )) @@ -141,9 +150,12 @@ App::get('/v1/locale/countries/eu') name: 'listCountriesEU', description: '/docs/references/locale/list-countries-eu.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_COUNTRY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COUNTRY_LIST, + ) + ], offlineModel: '/locale/countries/eu', offlineResponseKey: 'code' )) @@ -178,9 +190,12 @@ App::get('/v1/locale/countries/phones') name: 'listCountriesPhones', description: '/docs/references/locale/list-countries-phones.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PHONE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PHONE_LIST, + ) + ], offlineModel: '/locale/countries/phones', offlineResponseKey: 'countryCode' )) @@ -214,9 +229,12 @@ App::get('/v1/locale/continents') name: 'listContinents', description: '/docs/references/locale/list-continents.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_CONTINENT_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CONTINENT_LIST, + ) + ], offlineModel: '/locale/continents', offlineResponseKey: 'code' )) @@ -248,9 +266,12 @@ App::get('/v1/locale/currencies') name: 'listCurrencies', description: '/docs/references/locale/list-currencies.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_CURRENCY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CURRENCY_LIST, + ) + ], offlineModel: '/locale/currencies', offlineResponseKey: 'code' )) @@ -273,9 +294,12 @@ App::get('/v1/locale/languages') name: 'listLanguages', description: '/docs/references/locale/list-languages.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LANGUAGE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LANGUAGE_LIST, + ) + ], offlineModel: '/locale/languages', offlineResponseKey: 'code' )) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 54d8a7577e..44e77c953d 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -13,7 +13,7 @@ use Appwrite\Permission; use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -65,9 +65,12 @@ App::post('/v1/messaging/providers/mailgun') name: 'createMailgunProvider', description: '/docs/references/messaging/create-mailgun-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -155,9 +158,12 @@ App::post('/v1/messaging/providers/sendgrid') name: 'createSendgridProvider', description: '/docs/references/messaging/create-sendgrid-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -233,9 +239,12 @@ App::post('/v1/messaging/providers/smtp') name: 'createSmtpProvider', description: '/docs/references/messaging/create-smtp-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -324,9 +333,12 @@ App::post('/v1/messaging/providers/msg91') name: 'createMsg91Provider', description: '/docs/references/messaging/create-msg91-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -403,9 +415,12 @@ App::post('/v1/messaging/providers/telesign') name: 'createTelesignProvider', description: '/docs/references/messaging/create-telesign-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -483,9 +498,12 @@ App::post('/v1/messaging/providers/textmagic') name: 'createTextmagicProvider', description: '/docs/references/messaging/create-textmagic-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -563,9 +581,12 @@ App::post('/v1/messaging/providers/twilio') name: 'createTwilioProvider', description: '/docs/references/messaging/create-twilio-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -643,9 +664,12 @@ App::post('/v1/messaging/providers/vonage') name: 'createVonageProvider', description: '/docs/references/messaging/create-vonage-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -723,9 +747,12 @@ App::post('/v1/messaging/providers/fcm') name: 'createFcmProvider', description: '/docs/references/messaging/create-fcm-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -789,9 +816,12 @@ App::post('/v1/messaging/providers/apns') name: 'createApnsProvider', description: '/docs/references/messaging/create-apns-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') @@ -875,9 +905,12 @@ App::get('/v1/messaging/providers') name: 'listProviders', description: '/docs/references/messaging/list-providers.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_LIST, + ) + ] )) ->param('queries', [], new Providers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -934,9 +967,12 @@ App::get('/v1/messaging/providers/:providerId/logs') name: 'listProviderLogs', description: '/docs/references/messaging/list-provider-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -1025,9 +1061,12 @@ App::get('/v1/messaging/providers/:providerId') name: 'getProvider', description: '/docs/references/messaging/get-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('dbForProject') @@ -1055,9 +1094,12 @@ App::patch('/v1/messaging/providers/mailgun/:providerId') name: 'updateMailgunProvider', description: '/docs/references/messaging/update-mailgun-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1164,9 +1206,12 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId') name: 'updateSendgridProvider', description: '/docs/references/messaging/update-sendgrid-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1258,9 +1303,12 @@ App::patch('/v1/messaging/providers/smtp/:providerId') name: 'updateSmtpProvider', description: '/docs/references/messaging/update-smtp-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1383,9 +1431,12 @@ App::patch('/v1/messaging/providers/msg91/:providerId') name: 'updateMsg91Provider', description: '/docs/references/messaging/update-msg91-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1466,9 +1517,12 @@ App::patch('/v1/messaging/providers/telesign/:providerId') name: 'updateTelesignProvider', description: '/docs/references/messaging/update-telesign-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1551,9 +1605,12 @@ App::patch('/v1/messaging/providers/textmagic/:providerId') name: 'updateTextmagicProvider', description: '/docs/references/messaging/update-textmagic-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1636,9 +1693,12 @@ App::patch('/v1/messaging/providers/twilio/:providerId') name: 'updateTwilioProvider', description: '/docs/references/messaging/update-twilio-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1721,9 +1781,12 @@ App::patch('/v1/messaging/providers/vonage/:providerId') name: 'updateVonageProvider', description: '/docs/references/messaging/update-vonage-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1806,9 +1869,12 @@ App::patch('/v1/messaging/providers/fcm/:providerId') name: 'updateFcmProvider', description: '/docs/references/messaging/update-fcm-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1878,9 +1944,12 @@ App::patch('/v1/messaging/providers/apns/:providerId') name: 'updateApnsProvider', description: '/docs/references/messaging/update-apns-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_PROVIDER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) @@ -1976,9 +2045,12 @@ App::delete('/v1/messaging/providers/:providerId') name: 'deleteProvider', description: '/docs/references/messaging/delete-provider.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') @@ -2014,9 +2086,12 @@ App::post('/v1/messaging/topics') name: 'createTopic', description: '/docs/references/messaging/create-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOPIC, + ) + ] )) ->param('topicId', '', new CustomId(), 'Topic ID. Choose a custom Topic ID or a new Topic ID.') ->param('name', '', new Text(128), 'Topic Name.') @@ -2057,9 +2132,12 @@ App::get('/v1/messaging/topics') name: 'listTopics', description: '/docs/references/messaging/list-topics.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC_LIST, + ) + ] )) ->param('queries', [], new Topics(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Topics::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2116,9 +2194,12 @@ App::get('/v1/messaging/topics/:topicId/logs') name: 'listTopicLogs', description: '/docs/references/messaging/list-topic-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -2208,9 +2289,12 @@ App::get('/v1/messaging/topics/:topicId') name: 'getTopic', description: '/docs/references/messaging/get-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('dbForProject') @@ -2239,9 +2323,12 @@ App::patch('/v1/messaging/topics/:topicId') name: 'updateTopic', description: '/docs/references/messaging/update-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TOPIC + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('name', null, new Text(128), 'Topic Name.', true) @@ -2286,9 +2373,12 @@ App::delete('/v1/messaging/topics/:topicId') name: 'deleteTopic', description: '/docs/references/messaging/delete-topic.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') @@ -2329,9 +2419,12 @@ App::post('/v1/messaging/topics/:topicId/subscribers') name: 'createSubscriber', description: '/docs/references/messaging/create-subscriber.md', auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SUBSCRIBER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SUBSCRIBER, + ) + ] )) ->param('subscriberId', '', new CustomId(), 'Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.') ->param('topicId', '', new UID(), 'Topic ID. The topic ID to subscribe to.') @@ -2425,9 +2518,12 @@ App::get('/v1/messaging/topics/:topicId/subscribers') name: 'listSubscribers', description: '/docs/references/messaging/list-subscribers.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SUBSCRIBER_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SUBSCRIBER_LIST, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('queries', [], new Subscribers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) @@ -2507,9 +2603,12 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs') name: 'listSubscriberLogs', description: '/docs/references/messaging/list-subscriber-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -2599,9 +2698,12 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId') name: 'getSubscriber', description: '/docs/references/messaging/get-subscriber.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_SUBSCRIBER + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SUBSCRIBER, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -2644,9 +2746,12 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') name: 'deleteSubscriber', description: '/docs/references/messaging/delete-subscriber.md', auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -2706,9 +2811,12 @@ App::post('/v1/messaging/messages/email') name: 'createEmail', description: '/docs/references/messaging/create-email.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('subject', '', new Text(998), 'Email Subject.') @@ -2861,9 +2969,12 @@ App::post('/v1/messaging/messages/sms') name: 'createSms', description: '/docs/references/messaging/create-sms.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('content', '', new Text(64230), 'SMS Content.') @@ -2980,9 +3091,12 @@ App::post('/v1/messaging/messages/push') name: 'createPush', description: '/docs/references/messaging/create-push.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('title', '', new Text(256), 'Title for push notification.') @@ -3156,9 +3270,12 @@ App::get('/v1/messaging/messages') name: 'listMessages', description: '/docs/references/messaging/list-messages.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE_LIST, + ) + ], )) ->param('queries', [], new Messages(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Messages::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -3215,9 +3332,12 @@ App::get('/v1/messaging/messages/:messageId/logs') name: 'listMessageLogs', description: '/docs/references/messaging/list-message-logs.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_LOG_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -3307,9 +3427,12 @@ App::get('/v1/messaging/messages/:messageId/targets') name: 'listTargets', description: '/docs/references/messaging/list-message-targets.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_TARGET_LIST + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET_LIST, + ) + ], )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Targets::ALLOWED_ATTRIBUTES), true) @@ -3380,9 +3503,12 @@ App::get('/v1/messaging/messages/:messageId') name: 'getMessage', description: '/docs/references/messaging/get-message.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') @@ -3410,9 +3536,12 @@ App::patch('/v1/messaging/messages/email/:messageId') name: 'updateEmail', description: '/docs/references/messaging/update-email.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -3613,9 +3742,12 @@ App::patch('/v1/messaging/messages/sms/:messageId') name: 'updateSms', description: '/docs/references/messaging/update-sms.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -3771,9 +3903,12 @@ App::patch('/v1/messaging/messages/push/:messageId') name: 'updatePush', description: '/docs/references/messaging/update-push.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_MESSAGE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -4012,8 +4147,12 @@ App::delete('/v1/messaging/messages/:messageId') name: 'delete', description: '/docs/references/messaging/delete-message.md', auth: [AuthType::ADMIN, AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 1fb18e1e15..e41c23da69 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -9,7 +9,7 @@ use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -47,9 +47,12 @@ App::post('/v1/migrations/appwrite') name: 'createAppwriteMigration', description: '/docs/references/migrations/migration-appwrite.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") @@ -104,9 +107,12 @@ App::post('/v1/migrations/firebase/oauth') name: 'createFirebaseOAuthMigration', description: '/docs/references/migrations/migration-firebase.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID of the Firebase Project') @@ -209,9 +215,12 @@ App::post('/v1/migrations/firebase') name: 'createFirebaseMigration', description: '/docs/references/migrations/migration-firebase.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') @@ -272,9 +281,12 @@ App::post('/v1/migrations/supabase') name: 'createSupabaseMigration', description: '/docs/references/migrations/migration-supabase.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint') @@ -335,9 +347,12 @@ App::post('/v1/migrations/nhost') name: 'createNHostMigration', description: '/docs/references/migrations/migration-nhost.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain') @@ -398,9 +413,12 @@ App::get('/v1/migrations') name: 'list', description: '/docs/references/migrations/list-migrations.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_LIST, + ) + ] )) ->param('queries', [], new Migrations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Migrations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -459,9 +477,12 @@ App::get('/v1/migrations/:migrationId') name: 'get', description: '/docs/references/migrations/get-migration.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') @@ -485,9 +506,12 @@ App::get('/v1/migrations/appwrite/report') name: 'getAppwriteReport', description: '/docs/references/migrations/migration-appwrite-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") @@ -529,9 +553,12 @@ App::get('/v1/migrations/firebase/report') name: 'getFirebaseReport', description: '/docs/references/migrations/migration-firebase-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') @@ -578,9 +605,12 @@ App::get('/v1/migrations/firebase/report/oauth') name: 'getFirebaseReportOAuth', description: '/docs/references/migrations/migration-firebase-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('projectId', '', new Text(65536), 'Project ID') @@ -671,9 +701,12 @@ App::get('/v1/migrations/firebase/connect') name: 'createFirebaseAuth', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::HTML, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], hide: true, methodType: MethodType::WEBAUTH )) @@ -828,9 +861,12 @@ App::get('/v1/migrations/firebase/projects') name: 'listFirebaseProjects', description: '/docs/references/migrations/migration-firebase-projects.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST, + ) + ] )) ->inject('user') ->inject('response') @@ -919,9 +955,12 @@ App::get('/v1/migrations/firebase/deauthorize') name: 'deleteFirebaseAuth', description: '/docs/references/migrations/migration-firebase-deauthorize.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ] )) ->inject('user') ->inject('response') @@ -950,9 +989,12 @@ App::get('/v1/migrations/supabase/report') name: 'getSupabaseReport', description: '/docs/references/migrations/migration-supabase-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint.') @@ -995,9 +1037,12 @@ App::get('/v1/migrations/nhost/report') name: 'getNHostReport', description: '/docs/references/migrations/migration-nhost-report.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MIGRATION_REPORT, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate.') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain.') @@ -1043,9 +1088,12 @@ App::patch('/v1/migrations/:migrationId') name: 'retry', description: '/docs/references/migrations/retry-migration.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_ACCEPTED, - responseModel: Response::MODEL_MIGRATION, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') @@ -1090,9 +1138,12 @@ App::delete('/v1/migrations/:migrationId') name: 'delete', description: '/docs/references/migrations/delete-migration.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 1685a04152..3356497a13 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -3,7 +3,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; @@ -28,9 +28,12 @@ App::get('/v1/project/usage') name: 'getUsage', description: '/docs/references/project/get-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_PROJECT, + ) + ] )) ->param('startDate', '', new DateTimeValidator(), 'Starting date for the usage') ->param('endDate', '', new DateTimeValidator(), 'End date for the usage') @@ -324,9 +327,12 @@ App::post('/v1/project/variables') name: 'createVariable', description: '/docs/references/project/create-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_VARIABLE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) @@ -380,9 +386,12 @@ App::get('/v1/project/variables') name: 'listVariables', description: '/docs/references/project/list-variables.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_VARIABLE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE_LIST, + ) + ] )) ->inject('response') ->inject('dbForProject') @@ -407,9 +416,12 @@ App::get('/v1/project/variables/:variableId') name: 'getVariable', description: '/docs/references/project/get-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_VARIABLE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') @@ -433,9 +445,12 @@ App::put('/v1/project/variables/:variableId') name: 'updateVariable', description: '/docs/references/project/update-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_VARIABLE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) @@ -481,8 +496,12 @@ App::delete('/v1/project/variables/:variableId') name: 'deleteVariable', description: '/docs/references/project/delete-variable.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 901b94f579..c1251ecd8b 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -12,7 +12,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -70,9 +70,12 @@ App::post('/v1/projects') name: 'create', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new ProjectId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') @@ -263,9 +266,12 @@ App::get('/v1/projects') name: 'list', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT_LIST, + ) + ] )) ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -325,9 +331,12 @@ App::get('/v1/projects/:projectId') name: 'get', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -352,9 +361,12 @@ App::patch('/v1/projects/:projectId') name: 'update', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') @@ -402,9 +414,12 @@ App::patch('/v1/projects/:projectId/team') name: 'updateTeam', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('teamId', '', new UID(), 'Team ID of the team to transfer project to.') @@ -473,9 +488,12 @@ App::patch('/v1/projects/:projectId/service') name: 'updateServiceStatus', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])), true), 'Service name.') @@ -507,9 +525,12 @@ App::patch('/v1/projects/:projectId/service/all') name: 'updateServiceStatusAll', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'Service status.') @@ -544,9 +565,12 @@ App::patch('/v1/projects/:projectId/api') name: 'updateApiStatus', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('api', '', new WhiteList(array_keys(Config::getParam('apis')), true), 'API name.') @@ -578,9 +602,12 @@ App::patch('/v1/projects/:projectId/api/all') name: 'updateApiStatusAll', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'API status.') @@ -615,9 +642,12 @@ App::patch('/v1/projects/:projectId/oauth2') name: 'updateOAuth2', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'Provider Name') @@ -662,9 +692,12 @@ App::patch('/v1/projects/:projectId/auth/session-alerts') name: 'updateSessionAlerts', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('alerts', false, new Boolean(true), 'Set to true to enable session emails.') @@ -696,9 +729,12 @@ App::patch('/v1/projects/:projectId/auth/memberships-privacy') name: 'updateMembershipsPrivacy', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('userName', true, new Boolean(true), 'Set to true to show userName to members of a team.') @@ -734,9 +770,12 @@ App::patch('/v1/projects/:projectId/auth/limit') name: 'updateAuthLimit', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(0, APP_LIMIT_USERS), 'Set the max number of users allowed in this project. Use 0 for unlimited.') @@ -768,9 +807,12 @@ App::patch('/v1/projects/:projectId/auth/duration') name: 'updateAuthDuration', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('duration', 31536000, new Range(0, 31536000), 'Project session length in seconds. Max length: 31536000 seconds.') @@ -802,9 +844,12 @@ App::patch('/v1/projects/:projectId/auth/:method') name: 'updateAuthStatus', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('method', '', new WhiteList(\array_keys(Config::getParam('auth')), true), 'Auth Method. Possible values: ' . implode(',', \array_keys(Config::getParam('auth'))), false) @@ -839,9 +884,12 @@ App::patch('/v1/projects/:projectId/auth/password-history') name: 'updateAuthPasswordHistory', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', 0, new Range(0, APP_LIMIT_USER_PASSWORD_HISTORY), 'Set the max number of passwords to store in user history. User can\'t choose a new password that is already stored in the password history list. Max number of passwords allowed in history is' . APP_LIMIT_USER_PASSWORD_HISTORY . '. Default value is 0') @@ -873,9 +921,12 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary') name: 'updateAuthPasswordDictionary', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to enable checking user\'s password against most commonly used passwords. Default is false.') @@ -907,9 +958,12 @@ App::patch('/v1/projects/:projectId/auth/personal-data') name: 'updatePersonalDataCheck', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to check a password for similarity with personal data. Default is false.') @@ -941,9 +995,12 @@ App::patch('/v1/projects/:projectId/auth/max-sessions') name: 'updateAuthSessionsLimit', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(1, APP_LIMIT_USER_SESSIONS_MAX), 'Set the max number of users allowed in this project. Value allowed is between 1-' . APP_LIMIT_USER_SESSIONS_MAX . '. Default is ' . APP_LIMIT_USER_SESSIONS_DEFAULT) @@ -975,9 +1032,12 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers') name: 'updateMockNumbers', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('numbers', '', new ArrayList(new MockNumber(), 10), 'An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.') @@ -1018,9 +1078,12 @@ App::delete('/v1/projects/:projectId') name: 'delete', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1057,9 +1120,12 @@ App::post('/v1/projects/:projectId/webhooks') name: 'createWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') @@ -1118,9 +1184,12 @@ App::get('/v1/projects/:projectId/webhooks') name: 'listWebhooks', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK_LIST, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1153,9 +1222,12 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') name: 'getWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1190,9 +1262,12 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') name: 'updateWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1252,9 +1327,12 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') name: 'updateWebhookSignature', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_WEBHOOK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1294,9 +1372,12 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') name: 'deleteWebhook', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1337,9 +1418,12 @@ App::post('/v1/projects/:projectId/keys') name: 'createKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_KEY, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_KEY, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') @@ -1390,9 +1474,12 @@ App::get('/v1/projects/:projectId/keys') name: 'listKeys', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_KEY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY_LIST, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1425,9 +1512,12 @@ App::get('/v1/projects/:projectId/keys/:keyId') name: 'getKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_KEY, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1462,9 +1552,12 @@ App::put('/v1/projects/:projectId/keys/:keyId') name: 'updateKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_KEY, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1511,9 +1604,12 @@ App::delete('/v1/projects/:projectId/keys/:keyId') name: 'deleteKey', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1554,9 +1650,12 @@ App::post('/v1/projects/:projectId/jwts') name: 'createJWT', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_JWT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for JWT key. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') @@ -1593,9 +1692,12 @@ App::post('/v1/projects/:projectId/platforms') name: 'createPlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_PLATFORM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PLATFORM, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') @@ -1646,9 +1748,12 @@ App::get('/v1/projects/:projectId/platforms') name: 'listPlatforms', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PLATFORM_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM_LIST, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1681,9 +1786,12 @@ App::get('/v1/projects/:projectId/platforms/:platformId') name: 'getPlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PLATFORM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -1718,9 +1826,12 @@ App::put('/v1/projects/:projectId/platforms/:platformId') name: 'updatePlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PLATFORM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -1769,9 +1880,12 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') name: 'deletePlatform', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -1812,9 +1926,12 @@ App::patch('/v1/projects/:projectId/smtp') name: 'updateSmtp', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROJECT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') @@ -1905,9 +2022,12 @@ App::post('/v1/projects/:projectId/smtp/tests') name: 'createSmtpTest', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.') @@ -1968,9 +2088,12 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale') name: 'getSmsTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SMS_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2012,9 +2135,12 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale') name: 'getEmailTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_EMAIL_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') @@ -2067,9 +2193,12 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale') name: 'updateSmsTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SMS_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2110,9 +2239,12 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') name: 'updateEmailTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_EMAIL_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') @@ -2163,9 +2295,12 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') name: 'deleteSmsTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SMS_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2209,9 +2344,12 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') name: 'deleteEmailTemplate', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_EMAIL_TEMPLATE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 8818de0d54..2476bfdaba 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -7,7 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -36,9 +36,12 @@ App::post('/v1/proxy/rules') name: 'createRule', description: '/docs/references/proxy/create-rule.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_PROXY_RULE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROXY_RULE, + ) + ] )) ->param('domain', null, new ValidatorDomain(), 'Domain name.') ->param('resourceType', null, new WhiteList(['api', 'function']), 'Action definition for the rule. Possible values are "api", "function"') @@ -160,9 +163,12 @@ App::get('/v1/proxy/rules') name: 'listRules', description: '/docs/references/proxy/list-rules.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROXY_RULE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE_LIST, + ) + ] )) ->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -231,9 +237,12 @@ App::get('/v1/proxy/rules/:ruleId') name: 'getRule', description: '/docs/references/proxy/get-rule.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROXY_RULE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') @@ -265,8 +274,12 @@ App::delete('/v1/proxy/rules/:ruleId') name: 'deleteRule', description: '/docs/references/proxy/delete-rule.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') @@ -304,9 +317,12 @@ App::patch('/v1/proxy/rules/:ruleId/verification') name: 'updateRuleVerification', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PROXY_RULE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index fe4bba7640..59e831f057 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -11,6 +11,7 @@ use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; @@ -63,9 +64,12 @@ App::post('/v1/storage/buckets') name: 'createBucket', description: '/docs/references/storage/create-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_BUCKET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_BUCKET, + ) + ] )) ->param('bucketId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Bucket name') @@ -161,9 +165,12 @@ App::get('/v1/storage/buckets') name: 'listBuckets', description: '/docs/references/storage/list-buckets.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUCKET_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET_LIST, + ) + ] )) ->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -224,9 +231,12 @@ App::get('/v1/storage/buckets/:bucketId') name: 'getBucket', description: '/docs/references/storage/get-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUCKET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -255,9 +265,12 @@ App::put('/v1/storage/buckets/:bucketId') name: 'updateBucket', description: '/docs/references/storage/update-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_BUCKET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->param('name', null, new Text(128), 'Bucket name', false) @@ -321,8 +334,12 @@ App::delete('/v1/storage/buckets/:bucketId') name: 'deleteBucket', description: '/docs/references/storage/delete-bucket.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -371,9 +388,12 @@ App::post('/v1/storage/buckets/:bucketId/files') methodType: MethodType::UPLOAD, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], requestType: 'multipart/form-data', - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_FILE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_FILE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -735,9 +755,12 @@ App::get('/v1/storage/buckets/:bucketId/files') name: 'listFiles', description: '/docs/references/storage/list-files.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FILE_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE_LIST, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true) @@ -829,9 +852,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId') name: 'getFile', description: '/docs/references/storage/get-file.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FILE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -882,10 +908,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') name: 'getFilePreview', description: '/docs/references/storage/get-file-preview.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::IMAGE, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE + ) + ], methodType: MethodType::LOCATION, + responseType: ResponseType::IMAGE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID') @@ -1055,10 +1085,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') name: 'getFileDownload', description: '/docs/references/storage/get-file-download.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::ANY, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE + ) + ], methodType: MethodType::LOCATION, + responseType: ResponseType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1199,10 +1233,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') name: 'getFileView', description: '/docs/references/storage/get-file-view.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::ANY, - responseModel: Response::MODEL_NONE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], methodType: MethodType::LOCATION, + responseType: ResponseType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1515,9 +1553,12 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') name: 'updateFile', description: '/docs/references/storage/update-file.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_FILE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') @@ -1626,8 +1667,12 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') name: 'deleteFile', description: '/docs/references/storage/delete-file.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1720,9 +1765,12 @@ App::get('/v1/storage/usage') name: 'getUsage', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_USAGE_STORAGE, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_STORAGE, + ) + ] )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') @@ -1803,9 +1851,12 @@ App::get('/v1/storage/:bucketId/usage') name: 'getBucketUsage', description: '/docs/references/storage/get-bucket-usage.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, - responseModel: Response::MODEL_USAGE_BUCKETS, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_BUCKETS, + ) + ] )) ->param('bucketId', '', new UID(), 'Bucket ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index fc249e9c48..f364e4d871 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -13,7 +13,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -61,9 +61,12 @@ App::post('/v1/teams') name: 'create', description: '/docs/references/teams/create-team.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_TEAM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TEAM, + ) + ] )) ->param('teamId', '', new CustomId(), 'Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') @@ -148,9 +151,12 @@ App::get('/v1/teams') name: 'list', description: '/docs/references/teams/list-teams.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TEAM_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM_LIST, + ) + ], offlineModel: '/teams', )) ->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true) @@ -214,9 +220,12 @@ App::get('/v1/teams/:teamId') name: 'get', description: '/docs/references/teams/get-team.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TEAM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM, + ) + ], offlineModel: '/teams', offlineKey: '{teamId}', )) @@ -243,9 +252,12 @@ App::get('/v1/teams/:teamId/prefs') name: 'getPrefs', description: '/docs/references/teams/get-team-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ], offlineModel: '/teams/{teamId}/prefs', )) ->param('teamId', '', new UID(), 'Team ID.') @@ -276,9 +288,12 @@ App::put('/v1/teams/:teamId') name: 'updateName', description: '/docs/references/teams/update-team-name.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TEAM, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM, + ) + ], offlineModel: '/teams', offlineKey: '{teamId}', )) @@ -322,9 +337,12 @@ App::put('/v1/teams/:teamId/prefs') name: 'updatePrefs', description: '/docs/references/teams/update-team-prefs.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ], offlineModel: '/teams/{teamId}/prefs', )) ->param('teamId', '', new UID(), 'Team ID.') @@ -359,8 +377,12 @@ App::delete('/v1/teams/:teamId') name: 'delete', description: '/docs/references/teams/delete-team.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -412,9 +434,12 @@ App::post('/v1/teams/:teamId/memberships') name: 'createMembership', description: '/docs/references/teams/create-team-membership.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MEMBERSHIP, + ) + ] )) ->label('abuse-limit', 10) ->param('teamId', '', new UID(), 'Team ID.') @@ -739,9 +764,12 @@ App::get('/v1/teams/:teamId/memberships') name: 'listMemberships', description: '/docs/references/teams/list-team-members.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP_LIST, + ) + ], offlineModel: '/teams/{teamId}/memberships', )) ->param('teamId', '', new UID(), 'Team ID.') @@ -872,9 +900,12 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') name: 'getMembership', description: '/docs/references/teams/get-team-member.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ], offlineModel: '/teams/{teamId}/memberships', offlineKey: '{membershipId}', )) @@ -955,9 +986,12 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') name: 'updateMembership', description: '/docs/references/teams/update-team-membership.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') @@ -1040,9 +1074,12 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') name: 'updateMembershipStatus', description: '/docs/references/teams/update-team-membership-status.md', auth: [AuthType::SESSION, AuthType::JWT], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP, - responseType: ResponseType::JSON + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') @@ -1179,9 +1216,12 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') name: 'deleteMembership', description: '/docs/references/teams/delete-team-membership.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') @@ -1245,9 +1285,12 @@ App::get('/v1/teams/:teamId/logs') name: 'listLogs', description: '/docs/references/teams/get-team-logs.md', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 2898567280..b80bce1a2b 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -17,7 +17,7 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -200,9 +200,12 @@ App::post('/v1/users') name: 'create', description: '/docs/references/users/create-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', null, new Email(), 'User email.', true) @@ -231,9 +234,12 @@ App::post('/v1/users/bcrypt') name: 'createBcryptUser', description: '/docs/references/users/create-bcrypt-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -262,9 +268,12 @@ App::post('/v1/users/md5') name: 'createMD5User', description: '/docs/references/users/create-md5-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -293,9 +302,12 @@ App::post('/v1/users/argon2') name: 'createArgon2User', description: '/docs/references/users/create-argon2-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -324,9 +336,12 @@ App::post('/v1/users/sha') name: 'createSHAUser', description: '/docs/references/users/create-sha-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -362,9 +377,12 @@ App::post('/v1/users/phpass') name: 'createPHPassUser', description: '/docs/references/users/create-phpass-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -393,9 +411,12 @@ App::post('/v1/users/scrypt') name: 'createScryptUser', description: '/docs/references/users/create-scrypt-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -437,9 +458,12 @@ App::post('/v1/users/scrypt-modified') name: 'createScryptModifiedUser', description: '/docs/references/users/create-scrypt-modified-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -472,9 +496,12 @@ App::post('/v1/users/:userId/targets') name: 'createTarget', description: '/docs/references/users/create-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_TARGET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TARGET, + ) + ] )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('userId', '', new UID(), 'User ID.') @@ -560,9 +587,12 @@ App::get('/v1/users') name: 'list', description: '/docs/references/users/list-users.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER_LIST, + ) + ] )) ->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -622,9 +652,12 @@ App::get('/v1/users/:userId') name: 'get', description: '/docs/references/users/get-user.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -649,9 +682,12 @@ App::get('/v1/users/:userId/prefs') name: 'getPrefs', description: '/docs/references/users/get-user-prefs.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -678,9 +714,12 @@ App::get('/v1/users/:userId/targets/:targetId') name: 'getTarget', description: '/docs/references/users/get-user-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TARGET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -712,9 +751,12 @@ App::get('/v1/users/:userId/sessions') name: 'listSessions', description: '/docs/references/users/list-user-sessions.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_SESSION_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -755,9 +797,12 @@ App::get('/v1/users/:userId/memberships') name: 'listMemberships', description: '/docs/references/users/list-user-memberships.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MEMBERSHIP_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -796,9 +841,12 @@ App::get('/v1/users/:userId/logs') name: 'listLogs', description: '/docs/references/users/list-user-logs.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_LOG_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -887,9 +935,12 @@ App::get('/v1/users/:userId/targets') name: 'listTargets', description: '/docs/references/users/list-user-targets.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TARGET_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET_LIST, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) @@ -949,9 +1000,12 @@ App::get('/v1/users/identities') name: 'listIdentities', description: '/docs/references/users/list-identities.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_IDENTITY_LIST, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_IDENTITY_LIST, + ) + ] )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -1015,9 +1069,12 @@ App::patch('/v1/users/:userId/status') name: 'updateStatus', description: '/docs/references/users/update-user-status.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('status', null, new Boolean(true), 'User Status. To activate the user pass `true` and to block the user pass `false`.') @@ -1052,9 +1109,12 @@ App::put('/v1/users/:userId/labels') name: 'updateLabels', description: '/docs/references/users/update-user-labels.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('labels', [], new ArrayList(new Text(36, allowList: [...Text::NUMBERS, ...Text::ALPHABET_UPPER, ...Text::ALPHABET_LOWER]), APP_LIMIT_ARRAY_LABELS_SIZE), 'Array of user labels. Replaces the previous labels. Maximum of ' . APP_LIMIT_ARRAY_LABELS_SIZE . ' labels are allowed, each up to 36 alphanumeric characters long.') @@ -1091,9 +1151,12 @@ App::patch('/v1/users/:userId/verification/phone') name: 'updatePhoneVerification', description: '/docs/references/users/update-user-phone-verification.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('phoneVerification', false, new Boolean(), 'User phone verification status.') @@ -1129,9 +1192,12 @@ App::patch('/v1/users/:userId/name') name: 'updateName', description: '/docs/references/users/update-user-name.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('name', '', new Text(128, 0), 'User name. Max length: 128 chars.') @@ -1168,9 +1234,12 @@ App::patch('/v1/users/:userId/password') name: 'updatePassword', description: '/docs/references/users/update-user-password.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, enabled: $project->getAttribute('auths', [])['passwordDictionary'] ?? false, allowEmpty: true), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) @@ -1247,9 +1316,12 @@ App::patch('/v1/users/:userId/email') name: 'updateEmail', description: '/docs/references/users/update-user-email.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('email', '', new Email(allowEmpty: true), 'User email.') @@ -1343,9 +1415,12 @@ App::patch('/v1/users/:userId/phone') name: 'updatePhone', description: '/docs/references/users/update-user-phone.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('number', '', new Phone(allowEmpty: true), 'User phone number.') @@ -1429,9 +1504,12 @@ App::patch('/v1/users/:userId/verification') name: 'updateEmailVerification', description: '/docs/references/users/update-user-email-verification.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('emailVerification', false, new Boolean(), 'User email verification status.') @@ -1463,9 +1541,12 @@ App::patch('/v1/users/:userId/prefs') name: 'updatePrefs', description: '/docs/references/users/update-user-prefs.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_PREFERENCES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') @@ -1500,9 +1581,12 @@ App::patch('/v1/users/:userId/targets/:targetId') name: 'updateTarget', description: '/docs/references/users/update-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_TARGET, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -1601,9 +1685,12 @@ App::patch('/v1/users/:userId/mfa') name: 'updateMfa', description: '/docs/references/users/update-user-mfa.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') @@ -1637,9 +1724,12 @@ App::get('/v1/users/:userId/mfa/factors') name: 'listMfaFactors', description: '/docs/references/users/list-mfa-factors.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MFA_FACTORS, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1672,9 +1762,12 @@ App::get('/v1/users/:userId/mfa/recovery-codes') name: 'getMfaRecoveryCodes', description: '/docs/references/users/get-mfa-recovery-codes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1713,9 +1806,12 @@ App::patch('/v1/users/:userId/mfa/recovery-codes') name: 'createMfaRecoveryCodes', description: '/docs/references/users/create-mfa-recovery-codes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1761,9 +1857,12 @@ App::put('/v1/users/:userId/mfa/recovery-codes') name: 'updateMfaRecoveryCodes', description: '/docs/references/users/update-mfa-recovery-codes.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_MFA_RECOVERY_CODES, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -1808,9 +1907,12 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') name: 'deleteMfaAuthenticator', description: '/docs/references/users/delete-mfa-authenticator.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USER, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') @@ -1851,9 +1953,12 @@ App::post('/v1/users/:userId/sessions') name: 'createSession', description: '/docs/references/users/create-session.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_SESSION, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ] )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->inject('request') @@ -1922,9 +2027,12 @@ App::post('/v1/users/:userId/tokens') name: 'createToken', description: '/docs/references/users/create-token.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_TOKEN, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('length', 6, new Range(4, 128), 'Token length in characters. The default length is 6 characters', true) @@ -1981,9 +2089,12 @@ App::delete('/v1/users/:userId/sessions/:sessionId') name: 'deleteSession', description: '/docs/references/users/delete-user-session.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') @@ -2027,9 +2138,12 @@ App::delete('/v1/users/:userId/sessions') name: 'deleteSessions', description: '/docs/references/users/delete-user-sessions.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2072,9 +2186,12 @@ App::delete('/v1/users/:userId') name: 'delete', description: '/docs/references/users/delete.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2117,9 +2234,12 @@ App::delete('/v1/users/:userId/targets/:targetId') name: 'deleteTarget', description: '/docs/references/users/delete-target.md', auth: [AuthType::KEY, AuthType::ADMIN], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -2170,9 +2290,12 @@ App::delete('/v1/users/identities/:identityId') name: 'deleteIdentity', description: '/docs/references/users/delete-identity.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_NOCONTENT, - responseModel: Response::MODEL_NONE, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') @@ -2205,9 +2328,12 @@ App::post('/v1/users/:userId/jwts') name: 'createJWT', description: '/docs/references/users/create-user-jwt.md', auth: [AuthType::KEY], - responseCode: Response::STATUS_CODE_CREATED, - responseModel: Response::MODEL_JWT, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ] )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID. Use the string \'recent\' to use the most recent session. Defaults to the most recent session.', true) @@ -2257,9 +2383,12 @@ App::get('/v1/users/usage') name: 'getUsage', description: '', auth: [AuthType::ADMIN], - responseCode: Response::STATUS_CODE_OK, - responseModel: Response::MODEL_USAGE_USERS, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_USERS, + ) + ] )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 526fee27f9..3e31908bf9 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -7,6 +7,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; @@ -278,8 +279,12 @@ App::get('/v1/vcs/github/authorize') name: 'createGitHubInstallation', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_MOVED_PERMANENTLY, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], responseType: ResponseType::HTML, methodType: MethodType::WEBAUTH, hide: true, @@ -480,9 +485,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro name: 'getRepositoryContents', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_VCS_CONTENT_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VCS_CONTENT_LIST, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -543,9 +551,12 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr name: 'createRepositoryDetection', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_DETECTION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DETECTION, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -617,9 +628,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories') name: 'listRepositories', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_PROVIDER_REPOSITORY_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY_LIST, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -714,9 +728,12 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') name: 'createRepository', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_PROVIDER_REPOSITORY, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('name', '', new Text(256), 'Repository name (slug)') @@ -817,9 +834,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro name: 'getRepository', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_PROVIDER_REPOSITORY, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -868,9 +888,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro name: 'listRepositoryBranches', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_BRANCH_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BRANCH_LIST, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') @@ -1058,9 +1081,12 @@ App::get('/v1/vcs/installations') name: 'listInstallations', description: '/docs/references/vcs/list-installations.md', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_INSTALLATION_LIST, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INSTALLATION_LIST, + ) + ] )) ->param('queries', [], new Installations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Installations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -1126,9 +1152,12 @@ App::get('/v1/vcs/installations/:installationId') name: 'getInstallation', description: '/docs/references/vcs/get-installation.md', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_INSTALLATION, - responseCode: Response::STATUS_CODE_OK, - responseType: ResponseType::JSON, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INSTALLATION, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') @@ -1157,8 +1186,12 @@ App::delete('/v1/vcs/installations/:installationId') name: 'deleteInstallation', description: '/docs/references/vcs/delete-installation.md', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_NOCONTENT + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') @@ -1192,8 +1225,12 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor name: 'updateExternalDeployments', description: '', auth: [AuthType::ADMIN], - responseModel: Response::MODEL_NONE, - responseCode: Response::STATUS_CODE_NOCONTENT + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('repositoryId', '', new Text(256), 'VCS Repository Id') diff --git a/composer.lock b/composer.lock index f5a7dd7906..3dafef7083 100644 --- a/composer.lock +++ b/composer.lock @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.29.0", + "version": "v4.29.2", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587" + "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0ef6b2eb74b782f3f9023276c324d22e440f7587", - "reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/79aa5014efeeec3d137df5cdb0ae2fc163953945", + "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.0" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.2" }, - "time": "2024-11-27T18:37:40+00:00" + "time": "2024-12-18T14:11:12+00:00" }, { "name": "jean85/pretty-package-versions", @@ -1237,16 +1237,16 @@ }, { "name": "open-telemetry/api", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6" + "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/542064815d38a6df55af7957cd6f1d7d967c99c6", - "reference": "542064815d38a6df55af7957cd6f1d7d967c99c6", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", + "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", "shasum": "" }, "require": { @@ -1260,13 +1260,13 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.1.x-dev" - }, "spi": { "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" ] + }, + "branch-alias": { + "dev-main": "1.1.x-dev" } }, "autoload": { @@ -1303,7 +1303,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-10-15T22:42:37+00:00" + "time": "2024-11-16T04:32:30+00:00" }, { "name": "open-telemetry/context", @@ -1530,13 +1530,13 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.0.x-dev" - }, "spi": { "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" ] + }, + "branch-alias": { + "dev-main": "1.0.x-dev" } }, "autoload": { @@ -2403,12 +2403,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2453,23 +2453,23 @@ }, { "name": "symfony/http-client", - "version": "v7.2.0", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "955e43336aff03df1e8a8e17daefabb0127a313b" + "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/955e43336aff03df1e8a8e17daefabb0127a313b", - "reference": "955e43336aff03df1e8a8e17daefabb0127a313b", + "url": "https://api.github.com/repos/symfony/http-client/zipball/ff4df2b68d1c67abb9fef146e6540ea16b58d99e", + "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e", "shasum": "" }, "require": { "php": ">=8.2", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "~3.4.3|^3.5.1", + "symfony/http-client-contracts": "~3.4.4|^3.5.2", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -2528,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.0" + "source": "https://github.com/symfony/http-client/tree/v7.2.1" }, "funding": [ { @@ -2544,20 +2544,20 @@ "type": "tidelift" } ], - "time": "2024-11-29T08:22:02+00:00" + "time": "2024-12-07T08:50:44+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.1", + "version": "v3.5.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", - "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ee8d807ab20fcb51267fdace50fbe3494c31e645", + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645", "shasum": "" }, "require": { @@ -2565,12 +2565,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2606,7 +2606,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.2" }, "funding": [ { @@ -2622,7 +2622,7 @@ "type": "tidelift" } ], - "time": "2024-11-25T12:02:18+00:00" + "time": "2024-12-07T08:49:48+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2650,8 +2650,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2724,8 +2724,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2804,8 +2804,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2884,12 +2884,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2970,10 +2970,10 @@ }, "type": "composer-plugin", "extra": { + "class": "Nevay\\SPI\\Composer\\Plugin", "branch-alias": { "dev-main": "0.2.x-dev" }, - "class": "Nevay\\SPI\\Composer\\Plugin", "plugin-optional": true }, "autoload": { @@ -3678,16 +3678,16 @@ }, { "name": "utopia-php/framework", - "version": "0.33.14", + "version": "0.33.15", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "45a5a2db3602fa054096f378482c7da9936f5850" + "reference": "83b0628900c2c53e8c3efbf069f3e13050295edc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850", - "reference": "45a5a2db3602fa054096f378482c7da9936f5850", + "url": "https://api.github.com/repos/utopia-php/http/zipball/83b0628900c2c53e8c3efbf069f3e13050295edc", + "reference": "83b0628900c2c53e8c3efbf069f3e13050295edc", "shasum": "" }, "require": { @@ -3719,9 +3719,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.14" + "source": "https://github.com/utopia-php/http/tree/0.33.15" }, - "time": "2024-11-20T12:39:10+00:00" + "time": "2024-12-10T13:07:04+00:00" }, { "name": "utopia-php/image", @@ -4363,16 +4363,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.7", + "version": "0.18.8", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "0d9228faa1c202f9e01483e45a8950485f01a288" + "reference": "84737afa634e6a833fc4f8b0c967553234d3f215" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/0d9228faa1c202f9e01483e45a8950485f01a288", - "reference": "0d9228faa1c202f9e01483e45a8950485f01a288", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/84737afa634e6a833fc4f8b0c967553234d3f215", + "reference": "84737afa634e6a833fc4f8b0c967553234d3f215", "shasum": "" }, "require": { @@ -4412,9 +4412,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.7" + "source": "https://github.com/utopia-php/storage/tree/0.18.8" }, - "time": "2024-11-28T11:10:53+00:00" + "time": "2024-12-04T08:30:35+00:00" }, { "name": "utopia-php/swoole", @@ -4575,16 +4575,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.8.5", + "version": "0.8.6", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "7622330628d53844a3873ca873338150756bab82" + "reference": "b10225f54d5670f09f83e82e09de9d820ada6931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/7622330628d53844a3873ca873338150756bab82", - "reference": "7622330628d53844a3873ca873338150756bab82", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/b10225f54d5670f09f83e82e09de9d820ada6931", + "reference": "b10225f54d5670f09f83e82e09de9d820ada6931", "shasum": "" }, "require": { @@ -4618,9 +4618,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.5" + "source": "https://github.com/utopia-php/vcs/tree/0.8.6" }, - "time": "2024-11-11T18:33:10+00:00" + "time": "2024-12-10T13:13:23+00:00" }, { "name": "utopia-php/websocket", @@ -4807,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.25", + "version": "0.39.27", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1" + "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/5b5323636a8d75a1c4faaae9728098dd6a6a47d1", - "reference": "5b5323636a8d75a1c4faaae9728098dd6a6a47d1", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/27d8ecde30e40cbfe1124cc0430c406d3e144849", + "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849", "shasum": "" }, "require": { @@ -4852,9 +4852,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.39.25" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.27" }, - "time": "2024-11-08T10:16:34+00:00" + "time": "2024-12-16T11:32:02+00:00" }, { "name": "doctrine/annotations", @@ -4934,29 +4934,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -4964,7 +4962,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4975,9 +4973,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/instantiator", @@ -5809,16 +5807,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.0", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -5867,9 +5865,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-11-12T11:25:25+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -7578,16 +7576,16 @@ }, { "name": "symfony/console", - "version": "v7.2.0", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", - "reference": "23c8aae6d764e2bae02d2a99f7532a7f6ed619cf", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { @@ -7651,7 +7649,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.0" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -7667,7 +7665,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:24:19+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/filesystem", @@ -7892,8 +7890,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -7968,8 +7966,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -8046,8 +8044,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -8124,8 +8122,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -8558,7 +8556,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index ce4c55c9d8..e1dffaf099 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -87,12 +87,16 @@ class Method $this->validateAuthTypes($auth); // Disabled for now, will be enabled later // $this->validateDesc($description); - $this->validateResponseModel($responseModel); - // No content check - if ($responseCode === 204) { - if ($responseModel !== Response::MODEL_NONE) { - throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + foreach ($responses as $response) { + /** @var \Appwrite\SDK\Response $response */ + $this->validateResponseModel($response->getModel()); + + // No content check + if ($response->getCode() === 204) { + if ($response->getModel() !== Response::MODEL_NONE) { + throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + } } } } @@ -176,14 +180,9 @@ class Method return $this->auth; } - public function getResponseCode(): int + public function getResponses(): array { - return $this->responseCode; - } - - public function getResponseModel(): string|array - { - return $this->responseModel; + return $this->responses; } public function getResponseType(): ResponseType diff --git a/src/Appwrite/SDK/Response.php b/src/Appwrite/SDK/Response.php index 7b521549cb..9cd72951dc 100644 --- a/src/Appwrite/SDK/Response.php +++ b/src/Appwrite/SDK/Response.php @@ -6,22 +6,22 @@ class Response { /** * @param int $code - * @param string $model + * @param string|array $model * @param string $description */ - function __construct( + public function __construct( private int $code, - private string $model, + private string|array $model, private string $description = '', - ) - {} + ) { + } public function getCode(): int { return $this->code; } - public function getModel(): string + public function getModel(): string|array { return $this->model; } @@ -30,4 +30,4 @@ class Response { return $this->description; } -} \ No newline at end of file +} diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 842c473e78..9ed35f3c4c 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -142,7 +142,6 @@ class OpenAPI3 extends Format $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; $produces = ($sdk->getResponseType())->value; - $model = $sdk->getResponseModel() ?? 'none'; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -210,68 +209,74 @@ class OpenAPI3 extends Format } } - foreach ($this->models as $value) { - if (\is_array($model)) { - $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); - } else { - if ($value->getType() === $model) { - $model = $value; - break; + // Handle response models + foreach ($sdk->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $model = $response->getModel(); + + foreach ($this->models as $value) { + if (\is_array($model)) { + $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); + } else { + if ($value->getType() === $model) { + $model = $value; + break; + } } } - } - if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => in_array($produces, [ - 'image/*', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - 'image/svg-x', - 'image/x-icon', - 'image/bmp', - ]) ? 'Image' : 'File', - ]; - } else { - if (\is_array($model)) { - $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); - - // model has multiple possible responses, we will use oneOf - foreach ($model as $m) { - $usedModels[] = $m->getType(); - } - - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $modelDescription, - 'content' => [ - $produces => [ - 'schema' => [ - 'oneOf' => \array_map(fn ($m) => ['$ref' => '#/components/schemas/' . $m->getType()], $model) - ], - ], - ], + if (!(\is_array($model)) && $model->isNone()) { + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => in_array($produces, [ + 'image/*', + 'image/jpeg', + 'image/gif', + 'image/png', + 'image/webp', + 'image/svg-x', + 'image/x-icon', + 'image/bmp', + ]) ? 'Image' : 'File', ]; } else { - // Response definition using one type - $usedModels[] = $model->getType(); - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $model->getName(), - 'content' => [ - $produces => [ - 'schema' => [ - '$ref' => '#/components/schemas/' . $model->getType(), + if (\is_array($model)) { + $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); + + // model has multiple possible responses, we will use oneOf + foreach ($model as $m) { + $usedModels[] = $m->getType(); + } + + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $modelDescription, + 'content' => [ + $produces => [ + 'schema' => [ + 'oneOf' => \array_map(fn ($m) => ['$ref' => '#/components/schemas/' . $m->getType()], $model) + ], ], ], - ], - ]; + ]; + } else { + // Response definition using one type + $usedModels[] = $model->getType(); + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $model->getName(), + 'content' => [ + $produces => [ + 'schema' => [ + '$ref' => '#/components/schemas/' . $model->getType(), + ], + ], + ], + ]; + } } - } - if (($sdk->getResponseCode() ?? 500) === 204) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; - unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); + if (($response->getCode() ?? 500) === 204) { + $temp['responses'][(string)$response->getCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$response->getCode() ?? '500']['schema']); + } } if ((!empty($scope))) { // && 'public' != $scope diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 952064faaf..6f704366da 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -138,7 +138,6 @@ class Swagger2 extends Format $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; $produces = ($sdk->getResponseType())->value; - $model = $sdk->getResponseModel() ?? 'none'; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -212,63 +211,70 @@ class Swagger2 extends Format } } - foreach ($this->models as $value) { - if (\is_array($model)) { - $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); - } else { - if ($value->getType() === $model) { - $model = $value; - break; + // Handle Responses + + foreach ($sdk->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $model = $response->getModel(); + + foreach ($this->models as $value) { + if (\is_array($model)) { + $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); + } else { + if ($value->getType() === $model) { + $model = $value; + break; + } } } - } - if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => in_array($produces, [ - 'image/*', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - 'image/svg-x', - 'image/x-icon', - 'image/bmp', - ]) ? 'Image' : 'File', - 'schema' => [ - 'type' => 'file' - ], - ]; - } else { - if (\is_array($model)) { - $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); - // model has multiple possible responses, we will use oneOf - foreach ($model as $m) { - $usedModels[] = $m->getType(); - } - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $modelDescription, + if (!(\is_array($model)) && $model->isNone()) { + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => in_array($produces, [ + 'image/*', + 'image/jpeg', + 'image/gif', + 'image/png', + 'image/webp', + 'image/svg-x', + 'image/x-icon', + 'image/bmp', + ]) ? 'Image' : 'File', 'schema' => [ - 'x-oneOf' => \array_map(function ($m) { - return ['$ref' => '#/definitions/' . $m->getType()]; - }, $model) + 'type' => 'file' ], ]; } else { - // Response definition using one type - $usedModels[] = $model->getType(); - $temp['responses'][(string)$sdk->getResponseCode() ?? '500'] = [ - 'description' => $model->getName(), - 'schema' => [ - '$ref' => '#/definitions/' . $model->getType(), - ], - ]; + if (\is_array($model)) { + $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); + // model has multiple possible responses, we will use oneOf + foreach ($model as $m) { + $usedModels[] = $m->getType(); + } + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $modelDescription, + 'schema' => [ + 'x-oneOf' => \array_map(function ($m) { + return ['$ref' => '#/definitions/' . $m->getType()]; + }, $model) + ], + ]; + } else { + // Response definition using one type + $usedModels[] = $model->getType(); + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $model->getName(), + 'schema' => [ + '$ref' => '#/definitions/' . $model->getType(), + ], + ]; + } } - } - if (in_array($sdk->getResponseCode() ?? 500, [204, 301, 302, 308], true)) { - $temp['responses'][(string)$sdk->getResponseCode() ?? '500']['description'] = 'No content'; - unset($temp['responses'][(string)$sdk->getResponseCode() ?? '500']['schema']); + if (in_array($response->getCode() ?? 500, [204, 301, 302, 308], true)) { + $temp['responses'][(string)$response->getCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$response->getCode() ?? '500']['schema']); + } } if ((!empty($scope))) { // && 'public' != $scope From 0d6095ba18b6dce3d216c92fb0bbdead5801de1d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 3 Jan 2025 14:16:26 +0000 Subject: [PATCH 13/29] Add improved error handling for SDK Class --- app/http.php | 2 ++ composer.lock | 42 ++++++++++++++++++------------------- src/Appwrite/SDK/Method.php | 32 ++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/app/http.php b/app/http.php index 641143694d..42a9010482 100644 --- a/app/http.php +++ b/app/http.php @@ -2,6 +2,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; +use Appwrite\SDK\Method; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Swoole\Constant; @@ -335,4 +336,5 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } }); +Method::finaliseInitialization(); $http->start(); diff --git a/composer.lock b/composer.lock index 3dafef7083..e42376d236 100644 --- a/composer.lock +++ b/composer.lock @@ -4807,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.27", + "version": "0.39.28", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849" + "reference": "6ff467858fe418e364460da905139216570a5d5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/27d8ecde30e40cbfe1124cc0430c406d3e144849", - "reference": "27d8ecde30e40cbfe1124cc0430c406d3e144849", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/6ff467858fe418e364460da905139216570a5d5e", + "reference": "6ff467858fe418e364460da905139216570a5d5e", "shasum": "" }, "require": { @@ -4852,9 +4852,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.39.27" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.28" }, - "time": "2024-12-16T11:32:02+00:00" + "time": "2024-12-30T11:17:25+00:00" }, { "name": "doctrine/annotations", @@ -5126,16 +5126,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.3", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "cef51821608239040ab841ad6e1c6ae502ae3026" + "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/cef51821608239040ab841ad6e1c6ae502ae3026", - "reference": "cef51821608239040ab841ad6e1c6ae502ae3026", + "url": "https://api.github.com/repos/laravel/pint/zipball/8169513746e1bac70c85d6ea1524d9225d4886f0", + "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0", "shasum": "" }, "require": { @@ -5146,10 +5146,10 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.65.0", - "illuminate/view": "^10.48.24", - "larastan/larastan": "^2.9.11", - "laravel-zero/framework": "^10.4.0", + "friendsofphp/php-cs-fixer": "^3.66.0", + "illuminate/view": "^10.48.25", + "larastan/larastan": "^2.9.12", + "laravel-zero/framework": "^10.48.25", "mockery/mockery": "^1.6.12", "nunomaduro/termwind": "^1.17.0", "pestphp/pest": "^2.36.0" @@ -5188,7 +5188,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-11-26T15:34:00+00:00" + "time": "2024-12-30T16:20:10+00:00" }, { "name": "matthiasmullie/minify", @@ -5376,16 +5376,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -5428,9 +5428,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index e1dffaf099..afae57b0d3 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -37,6 +37,11 @@ class Method { public static array $knownMethods = []; + //Tmp + public static array $knownMissingDescriptions = []; + + public static array $exceptions = []; + /** * @var array */ @@ -85,8 +90,7 @@ class Method ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); - // Disabled for now, will be enabled later - // $this->validateDesc($description); + $this->validateDesc($description); foreach ($responses as $response) { /** @var \Appwrite\SDK\Response $response */ @@ -95,7 +99,7 @@ class Method // No content check if ($response->getCode() === 204) { if ($response->getModel() !== Response::MODEL_NONE) { - throw new \Exception("Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"; } } } @@ -109,7 +113,7 @@ class Method private function validateMethod(string $name, string $namespace): void { if (\in_array($this->getDebugName(), self::$knownMethods)) { - throw new \Exception('Method ' . $name . ' already exists in namespace ' . $namespace); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Method already exists in namespace {$namespace}"; } self::$knownMethods[] = $this->getDebugName(); @@ -119,7 +123,7 @@ class Method { foreach ($authTypes as $authType) { if (!($authType instanceof AuthType)) { - throw new \Exception("Error with {$this->getDebugName()} method: Invalid auth type"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid auth type"; } } } @@ -127,13 +131,15 @@ class Method private function validateDesc(string $desc): void { if (empty($desc)) { - throw new \Exception("Error with {$this->getDebugName()} method: Description file not set"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Description label is empty"; + return; } $descPath = \realpath(__DIR__ . '/../../../' . $desc); if (!\file_exists($descPath)) { - throw new \Exception("Error with {$this->getDebugName()} method: Description file not found at {$descPath}"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Description file not found at {$desc}"; + return; } } @@ -146,7 +152,7 @@ class Method try { $response->getModel($model); } catch (\Exception $e) { - throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; } } @@ -156,7 +162,7 @@ class Method try { $response->getModel($responseModel); } catch (\Exception $e) { - throw new \Exception("Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"); + self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; } } @@ -239,4 +245,12 @@ class Method { return $this->multiplex; } + + // Throw any errors that were found during initialization + static function finaliseInitialization(): void + { + if (!empty(self::$exceptions)) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$exceptions)); + } + } } From 87de19b61070f6d5983f69b176befb450e94bc5d Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jan 2025 02:07:56 +0900 Subject: [PATCH 14/29] Address Comments --- app/config/specs/open-api3-latest-client.json | 23 ++-- .../specs/open-api3-latest-console.json | 23 ++-- app/config/specs/open-api3-latest-server.json | 23 ++-- app/config/specs/swagger2-latest-client.json | 41 +++---- app/config/specs/swagger2-latest-console.json | 41 +++---- app/config/specs/swagger2-latest-server.json | 41 +++---- app/controllers/api/databases.php | 67 +++++++----- src/Appwrite/GraphQL/Schema.php | 8 ++ src/Appwrite/Platform/Tasks/Specs.php | 101 ++++++++++-------- src/Appwrite/SDK/AuthType.php | 11 ++ src/Appwrite/SDK/Method.php | 90 +++++----------- src/Appwrite/SDK/MethodType.php | 11 ++ src/Appwrite/SDK/ResponseType.php | 15 +++ .../Specification/Format/OpenAPI3.php | 45 ++++++-- .../Specification/Format/Swagger2.php | 46 ++++++-- 15 files changed, 306 insertions(+), 280 deletions(-) create mode 100644 src/Appwrite/SDK/AuthType.php create mode 100644 src/Appwrite/SDK/MethodType.php create mode 100644 src/Appwrite/SDK/ResponseType.php diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index cffba28434..9164bb0a7f 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4564,22 +4564,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/components\/schemas\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -4589,7 +4574,11 @@ "documents" ], "responses": [ - "#\/components\/schemas\/documentList" + { + "code": 201, + "description": "", + "model": "#\/components\/schemas\/document" + } ] } ], diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a9afe4b0e1..484b25e18e 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8133,22 +8133,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/components\/schemas\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -8158,7 +8143,11 @@ "documents" ], "responses": [ - "#\/components\/schemas\/documentList" + { + "code": 201, + "description": "", + "model": "#\/components\/schemas\/document" + } ] } ], diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 4960002943..0656264d09 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7667,22 +7667,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/components\/schemas\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -7692,7 +7677,11 @@ "documents" ], "responses": [ - "#\/components\/schemas\/documentList" + { + "code": 201, + "description": "", + "model": "#\/components\/schemas\/document" + } ] } ], diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 2bb9cd265c..65e28ff79d 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4752,22 +4752,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/definitions\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -4777,7 +4762,11 @@ "documents" ], "responses": [ - "#\/definitions\/documentList" + { + "code": 201, + "description": "", + "model": "#\/definitions\/document" + } ] } ], @@ -4817,14 +4806,14 @@ "properties": { "documentId": { "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", + "description": "", + "default": null, "x-example": "" }, "data": { "type": "object", - "description": "Document data as JSON object.", - "default": [], + "description": "", + "default": {}, "x-example": "{}" }, "documents": { @@ -4838,14 +4827,18 @@ }, "permissions": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, + "description": "", + "default": [], "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - } + }, + "required": [ + "documentId", + "data" + ] } } ] diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index bde121a094..5ac694787c 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8336,22 +8336,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/definitions\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -8361,7 +8346,11 @@ "documents" ], "responses": [ - "#\/definitions\/documentList" + { + "code": 201, + "description": "", + "model": "#\/definitions\/document" + } ] } ], @@ -8401,14 +8390,14 @@ "properties": { "documentId": { "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", + "description": "", + "default": null, "x-example": "" }, "data": { "type": "object", - "description": "Document data as JSON object.", - "default": [], + "description": "", + "default": {}, "x-example": "{}" }, "documents": { @@ -8422,14 +8411,18 @@ }, "permissions": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, + "description": "", + "default": [], "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - } + }, + "required": [ + "documentId", + "data" + ] } } ] diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index f51bba17cd..64544d2a03 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7848,22 +7848,7 @@ "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", "offline-key": "{documentId}", "offline-response-key": "$id", - "multiplex": [ - { - "name": "createDocument", - "parameters": [ - "documentId", - "data", - "permissions" - ], - "required": [ - "documentId", - "data" - ], - "responses": [ - "#\/definitions\/document" - ] - }, + "additional-methods": [ { "name": "createDocuments", "parameters": [ @@ -7873,7 +7858,11 @@ "documents" ], "responses": [ - "#\/definitions\/documentList" + { + "code": 201, + "description": "", + "model": "#\/definitions\/document" + } ] } ], @@ -7915,14 +7904,14 @@ "properties": { "documentId": { "type": "string", - "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", - "default": "", + "description": "", + "default": null, "x-example": "" }, "data": { "type": "object", - "description": "Document data as JSON object.", - "default": [], + "description": "", + "default": {}, "x-example": "{}" }, "documents": { @@ -7936,14 +7925,18 @@ }, "permissions": { "type": "array", - "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", - "default": null, + "description": "", + "default": [], "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - } + }, + "required": [ + "documentId", + "data" + ] } } ] diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 5c7479ffac..124de445c3 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3096,35 +3096,46 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label( 'sdk', - new Method( - namespace: 'databases', - name: 'createDocument', - description: '/docs/references/databases/create-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT, - ) - ], - responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - multiplex: [ - new Multiplex( - name: 'createDocument', - parameters: ['documentId', 'data', 'permissions'], - required: ['documentId', 'data'], - responseModel: Response::MODEL_DOCUMENT, - ), - new Multiplex( + [ + new Method( + namespace: 'databases', + name: 'createDocument', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + parameters: [ + 'documentId' => ['default' => [], 'validator' => new CustomId(), 'description' => '', 'optional' => false], + 'data' => ['default' => [], 'validator' => new JSON(), 'description' => '', 'optional' => false], + 'permissions' => ['default' => [], 'validator' => new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'description' => '', 'optional' => true], + ] + ), + new Method( + namespace: 'databases', name: 'createDocuments', - parameters: ['documents'], - required: ['documents'], - responseModel: Response::MODEL_DOCUMENT_LIST, - ), - ] - ) + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + parameters: [ + 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], + ] + ) + ] ) ->param('databaseId', '', new UID(), 'Database ID.') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true) diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index b8daadefef..44a85d2d27 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -105,6 +105,14 @@ class Schema continue; } + $additionalMethods = null; + if (is_array($sdk)) { + $mainSdk = array_shift($sdk); + $additionalMethods = $sdk; + + $sdk = $mainSdk; + } + $namespace = $sdk->getNamespace(); $method = $sdk->getMethodName(); $name = $namespace . \ucfirst($method); diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 6229899a9a..627ac8c912 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -183,62 +183,69 @@ class Specs extends Action foreach ($appRoutes as $key => $method) { foreach ($method as $route) { - $sdk = $route->getLabel('sdk', false); + $sdks = $route->getLabel('sdk', false); - /** @var \Appwrite\SDK\Method $sdk */ - if (empty($sdk)) { + if (empty($sdks)) { continue; } - $hide = $sdk->isHidden(); - if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { - continue; + if (!\is_array($sdks)) { + $sdks = [$sdks]; } - $routeSecurity = $sdk->getAuth(); - $sdkPlatforms = []; + foreach ($sdks as $sdk) { + /** @var \Appwrite\SDK\Method $sdks */ - foreach ($routeSecurity as $value) { - switch ($value) { - case AuthType::SESSION: - $sdkPlatforms[] = APP_PLATFORM_CLIENT; - break; - case AuthType::JWT: - case AuthType::KEY: - $sdkPlatforms[] = APP_PLATFORM_SERVER; - break; - case AuthType::ADMIN: - $sdkPlatforms[] = APP_PLATFORM_CONSOLE; - break; + $hide = $sdk->isHidden(); + if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { + continue; } + + $routeSecurity = $sdk->getAuth(); + $sdkPlatforms = []; + + foreach ($routeSecurity as $value) { + switch ($value) { + case AuthType::SESSION: + $sdkPlatforms[] = APP_PLATFORM_CLIENT; + break; + case AuthType::JWT: + case AuthType::KEY: + $sdkPlatforms[] = APP_PLATFORM_SERVER; + break; + case AuthType::ADMIN: + $sdkPlatforms[] = APP_PLATFORM_CONSOLE; + break; + } + } + + if (empty($routeSecurity)) { + $sdkPlatforms[] = APP_PLATFORM_SERVER; + $sdkPlatforms[] = APP_PLATFORM_CLIENT; + } + + if (!$route->getLabel('docs', true)) { + continue; + } + + if ($route->getLabel('mock', false) && !$mocks) { + continue; + } + + if (!$route->getLabel('mock', false) && $mocks) { + continue; + } + + if (empty($sdk->getNamespace())) { + continue; + } + + if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { + continue; + } + + $routes[] = $route; } - - if (empty($routeSecurity)) { - $sdkPlatforms[] = APP_PLATFORM_SERVER; - $sdkPlatforms[] = APP_PLATFORM_CLIENT; - } - - if (!$route->getLabel('docs', true)) { - continue; - } - - if ($route->getLabel('mock', false) && !$mocks) { - continue; - } - - if (!$route->getLabel('mock', false) && $mocks) { - continue; - } - - if (empty($sdk->getNamespace())) { - continue; - } - - if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { - continue; - } - - $routes[] = $route; } } diff --git a/src/Appwrite/SDK/AuthType.php b/src/Appwrite/SDK/AuthType.php new file mode 100644 index 0000000000..e2ae5ead4d --- /dev/null +++ b/src/Appwrite/SDK/AuthType.php @@ -0,0 +1,11 @@ + - */ - protected array $multiplexRoutes = []; + public static array $errors = []; /** * Initialise a new SDK method @@ -54,7 +19,7 @@ class Method * @param string $name * @param string $description * @param array $auth - * @param array $responses + * @param array $responses * @param int $responseCode * @param string|array $responseModel * @param ResponseType $responseType @@ -85,45 +50,40 @@ class Method protected array|bool $hide = false, protected bool $packaging = false, protected string $requestType = 'application/json', - protected array $parameters = [], - protected array $multiplex = [] + protected array $parameters = [] ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); - $this->validateDesc($description); + //$this->validateDesc($description); foreach ($responses as $response) { - /** @var \Appwrite\SDK\Response $response */ + /** @var SDKResponse $response */ $this->validateResponseModel($response->getModel()); // No content check - if ($response->getCode() === 204) { - if ($response->getModel() !== Response::MODEL_NONE) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Response code 204 must have response model 'none'"; - } - } + $this->validateNoContent($response); } } - private function getDebugName(): string + private function getRouteName(): string { return $this->namespace . '.' . $this->name; } private function validateMethod(string $name, string $namespace): void { - if (\in_array($this->getDebugName(), self::$knownMethods)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Method already exists in namespace {$namespace}"; + if (\in_array($this->getRouteName(), self::$knownMethods)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Method already exists in namespace {$namespace}"; } - self::$knownMethods[] = $this->getDebugName(); + self::$knownMethods[] = $this->getRouteName(); } private function validateAuthTypes(array $authTypes): void { foreach ($authTypes as $authType) { if (!($authType instanceof AuthType)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid auth type"; + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid auth type"; } } } @@ -131,14 +91,14 @@ class Method private function validateDesc(string $desc): void { if (empty($desc)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Description label is empty"; + self::$errors[] = "Error with {$this->getRouteName()} method: Description label is empty"; return; } $descPath = \realpath(__DIR__ . '/../../../' . $desc); if (!\file_exists($descPath)) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Description file not found at {$desc}"; + self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; return; } } @@ -152,7 +112,7 @@ class Method try { $response->getModel($model); } catch (\Exception $e) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; } } @@ -162,7 +122,16 @@ class Method try { $response->getModel($responseModel); } catch (\Exception $e) { - self::$exceptions[] = "Error with {$this->getDebugName()} method: Invalid response model, make sure the model has been defined in Response.php"; + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; + } + } + + private function validateNoContent(SDKResponse $response): void + { + if ($response->getCode() === 204) { + if ($response->getModel() !== Response::MODEL_NONE) { + self::$errors[] = "Error with {$this->getRouteName()} method: Response code 204 must have response model 'none'"; + } } } @@ -241,16 +210,11 @@ class Method return $this->parameters; } - public function getMultiplex(): array - { - return $this->multiplex; - } - // Throw any errors that were found during initialization static function finaliseInitialization(): void { - if (!empty(self::$exceptions)) { - throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$exceptions)); + if (!empty(self::$errors)) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$errors)); } } } diff --git a/src/Appwrite/SDK/MethodType.php b/src/Appwrite/SDK/MethodType.php new file mode 100644 index 0000000000..b4982c847a --- /dev/null +++ b/src/Appwrite/SDK/MethodType.php @@ -0,0 +1,11 @@ +getMultiplex())) { - $temp['x-appwrite']['multiplex'] = []; - foreach ($sdk->getMultiplex() as $multiplex) { - /** @var \Appwrite\SDK\Multiplex $multiplex */ - $temp['x-appwrite']['multiplex'][] = [ - 'name' => $multiplex->getName(), - 'parameters' => $multiplex->getParameters(), - 'required' => $multiplex->getRequired(), - 'responses' => ['#/components/schemas/' . $multiplex->getResponseModel()] + if (!empty($additionalMethods)) { + $temp['x-appwrite']['additional-methods'] = []; + foreach ($additionalMethods as $method) { + /** @var \Appwrite\SDK\Method $method */ + $additionalMethod = [ + 'name' => $method->getMethodName(), + 'parameters' => [], + 'required' => [], + 'responses' => [] ]; + + foreach ($method->getParameters() as $name => $param) { + $additionalMethod['parameters'][] = $name; + + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } + } + + foreach ($method->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'description' => $response->getDescription(), + 'model' => '#/components/schemas/' . $response->getModel() + ]; + } + + $temp['x-appwrite']['additional-methods'][] = $additionalMethod; } } diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 6f704366da..34f6c99b37 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -128,6 +128,14 @@ class Swagger2 extends Format continue; } + $additionalMethods = null; + if (is_array($sdk)) { + $mainSdk = array_shift($sdk); + $additionalMethods = $sdk; + + $sdk = $mainSdk; + } + $consumes = [$sdk->getRequestType()]; $method = $sdk->getMethodName() ?? \uniqid(); @@ -197,17 +205,35 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } - if (!empty($sdk->getMultiplex())) { - $temp['x-appwrite']['multiplex'] = []; - foreach ($sdk->getMultiplex() as $multiplex) { - /** @var \Appwrite\SDK\Multiplex $multiplex */ - - $temp['x-appwrite']['multiplex'][] = [ - 'name' => $multiplex->getName(), - 'parameters' => $multiplex->getParameters(), - 'required' => $multiplex->getRequired(), - 'responses' => ["#/definitions/" . $multiplex->getResponseModel()] + if (!empty($additionalMethods)) { + $temp['x-appwrite']['additional-methods'] = []; + foreach ($additionalMethods as $method) { + /** @var \Appwrite\SDK\Method $method */ + $additionalMethod = [ + 'name' => $method->getMethodName(), + 'parameters' => [], + 'required' => [], + 'responses' => [] ]; + + foreach ($method->getParameters() as $name => $param) { + $additionalMethod['parameters'][] = $name; + + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } + } + + foreach ($method->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'description' => $response->getDescription(), + 'model' => '#/definitions/' . $response->getModel() + ]; + } + + $temp['x-appwrite']['additional-methods'][] = $additionalMethod; } } From a1c70a695623d2d2f854c584bc4155f9e8ee9ae3 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jan 2025 14:23:04 +0900 Subject: [PATCH 15/29] Run Formatter, Fix GraphQL --- app/controllers/api/databases.php | 33 ++++++++------- app/controllers/shared/api.php | 4 ++ src/Appwrite/GraphQL/Schema.php | 2 +- src/Appwrite/GraphQL/Types/Mapper.php | 31 +++++++++++--- src/Appwrite/Platform/Tasks/Specs.php | 18 ++++----- src/Appwrite/SDK/AuthType.php | 2 +- src/Appwrite/SDK/Method.php | 9 +++-- src/Appwrite/SDK/MethodType.php | 2 +- src/Appwrite/SDK/Multiplex.php | 40 ------------------- src/Appwrite/SDK/ResponseType.php | 2 +- .../Specification/Format/OpenAPI3.php | 2 +- .../Specification/Format/Swagger2.php | 2 +- 12 files changed, 66 insertions(+), 81 deletions(-) delete mode 100644 src/Appwrite/SDK/Multiplex.php diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 124de445c3..e0f441ed64 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -9,7 +9,6 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; -use Appwrite\SDK\Multiplex; use Appwrite\SDK\Response as SDKResponse; use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; @@ -3118,22 +3117,22 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ] ), new Method( - namespace: 'databases', - name: 'createDocuments', - description: '/docs/references/databases/create-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - responses: [ - new SDKResponse( - code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT, - ) - ], - responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - parameters: [ - 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], - ] + namespace: 'databases', + name: 'createDocuments', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], + responseType: ResponseType::JSON, + offlineKey: '{documentId}', + offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + parameters: [ + 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], + ] ) ] ) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index d0d433410b..1036890a00 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -348,6 +348,10 @@ App::init() */ $method = $route->getLabel('sdk', false); + if (is_array($method)) { + $method = $method[0]; + } + if (!empty($method)) { $namespace = $method->getNamespace(); if ( diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index 44a85d2d27..cbef55ef8d 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -109,7 +109,7 @@ class Schema if (is_array($sdk)) { $mainSdk = array_shift($sdk); $additionalMethods = $sdk; - + $sdk = $mainSdk; } diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 35cc9e28cc..4bad3e968f 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -86,17 +86,38 @@ class Mapper } } - /** @var \Appwrite\SDK\Method $sdk */ $sdk = $route->getLabel('sdk', false); if (!$sdk) { return; } - $names = $sdk->getResponseModel() ?? []; - $models = \is_array($names) - ? \array_map(static fn ($m) => static::$models[$m], $names) - : [static::$models[$names]]; + if (is_array($sdk)) { + $sdk = $sdk[0]; + } + + /** @var \Appwrite\SDK\Method $sdk */ + $responses = $sdk->getResponses() ?? []; + + // If responses is an array, map each response to its model + if (\is_array($responses)) { + $models = []; + foreach ($responses as $response) { + $modelName = $response->getModel(); + + if (\is_array($modelName)) { + foreach ($modelName as $name) { + $models[] = static::$models[$name]; + } + } else { + $models[] = static::$models[$modelName]; + } + } + } else { + // If single response, get its model and wrap in array + $modelName = $responses->getModel(); + $models = [static::$models[$modelName]]; + } foreach ($models as $model) { $type = Mapper::model(\ucfirst($model->getType())); diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 627ac8c912..02a60b81e9 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -200,10 +200,10 @@ class Specs extends Action if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { continue; } - + $routeSecurity = $sdk->getAuth(); $sdkPlatforms = []; - + foreach ($routeSecurity as $value) { switch ($value) { case AuthType::SESSION: @@ -218,32 +218,32 @@ class Specs extends Action break; } } - + if (empty($routeSecurity)) { $sdkPlatforms[] = APP_PLATFORM_SERVER; $sdkPlatforms[] = APP_PLATFORM_CLIENT; } - + if (!$route->getLabel('docs', true)) { continue; } - + if ($route->getLabel('mock', false) && !$mocks) { continue; } - + if (!$route->getLabel('mock', false) && $mocks) { continue; } - + if (empty($sdk->getNamespace())) { continue; } - + if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { continue; } - + $routes[] = $route; } } diff --git a/src/Appwrite/SDK/AuthType.php b/src/Appwrite/SDK/AuthType.php index e2ae5ead4d..307b3cf35e 100644 --- a/src/Appwrite/SDK/AuthType.php +++ b/src/Appwrite/SDK/AuthType.php @@ -8,4 +8,4 @@ enum AuthType: string case KEY = APP_AUTH_TYPE_KEY; case SESSION = APP_AUTH_TYPE_SESSION; case ADMIN = APP_AUTH_TYPE_ADMIN; -} \ No newline at end of file +} diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 8a8bd8c9d1..6a809662d2 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -2,8 +2,8 @@ namespace Appwrite\SDK; -use Appwrite\Utopia\Response; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response; use Swoole\Http\Response as HttpResponse; class Method @@ -20,8 +20,6 @@ class Method * @param string $description * @param array $auth * @param array $responses - * @param int $responseCode - * @param string|array $responseModel * @param ResponseType $responseType * @param MethodType|null $methodType * @param string|null $offlineKey @@ -155,6 +153,9 @@ class Method return $this->auth; } + /** + * @return Array + */ public function getResponses(): array { return $this->responses; @@ -211,7 +212,7 @@ class Method } // Throw any errors that were found during initialization - static function finaliseInitialization(): void + public static function finaliseInitialization(): void { if (!empty(self::$errors)) { throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$errors)); diff --git a/src/Appwrite/SDK/MethodType.php b/src/Appwrite/SDK/MethodType.php index b4982c847a..2b1f786779 100644 --- a/src/Appwrite/SDK/MethodType.php +++ b/src/Appwrite/SDK/MethodType.php @@ -8,4 +8,4 @@ enum MethodType: string case LOCATION = 'location'; case GRAPHQL = 'graphql'; case UPLOAD = 'upload'; -} \ No newline at end of file +} diff --git a/src/Appwrite/SDK/Multiplex.php b/src/Appwrite/SDK/Multiplex.php deleted file mode 100644 index 4129169528..0000000000 --- a/src/Appwrite/SDK/Multiplex.php +++ /dev/null @@ -1,40 +0,0 @@ - $parameters - * @param array $required - * @param string $responseModel - */ - public function __construct( - private string $name, - private array $parameters, - private array $required, - private string $responseModel - ) { - } - - public function getName(): string - { - return $this->name; - } - - public function getParameters(): array - { - return $this->parameters; - } - - public function getRequired(): array - { - return $this->required; - } - - public function getResponseModel(): string - { - return $this->responseModel; - } -} diff --git a/src/Appwrite/SDK/ResponseType.php b/src/Appwrite/SDK/ResponseType.php index e2f5d32e5e..8d34fb1a90 100644 --- a/src/Appwrite/SDK/ResponseType.php +++ b/src/Appwrite/SDK/ResponseType.php @@ -12,4 +12,4 @@ enum ResponseType: string case HTML = 'text/html'; case TEXT = 'text/plain'; case ANY = '*/*'; -} \ No newline at end of file +} diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index c1ab9a8250..9abf94e6c2 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -214,7 +214,7 @@ class OpenAPI3 extends Format 'required' => [], 'responses' => [] ]; - + foreach ($method->getParameters() as $name => $param) { $additionalMethod['parameters'][] = $name; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 34f6c99b37..59e5b96106 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -215,7 +215,7 @@ class Swagger2 extends Format 'required' => [], 'responses' => [] ]; - + foreach ($method->getParameters() as $name => $param) { $additionalMethod['parameters'][] = $name; From 8f2cca5b0f80ec8cf5e4780d46c29d21ff1a40ed Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 10 Jan 2025 16:53:09 +0900 Subject: [PATCH 16/29] Fix Response Models --- app/controllers/api/users.php | 7 --- app/controllers/general.php | 29 ++++++++- docs/tutorials/add-route.md | 20 ++++--- src/Appwrite/SDK/Method.php | 98 +++++++++++++++++++++++++++++++ src/Appwrite/Utopia/Request.php | 10 +++- tests/unit/Utopia/RequestTest.php | 10 +++- 6 files changed, 154 insertions(+), 20 deletions(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index b80bce1a2b..c9fc6a5cd0 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -188,13 +188,6 @@ App::post('/v1/users') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/users/create-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) ->label('sdk', new Method( namespace: 'users', name: 'create', diff --git a/app/controllers/general.php b/app/controllers/general.php index 663242882a..4cee363317 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -10,6 +10,10 @@ use Appwrite\Event\Func; use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; @@ -93,8 +97,29 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $type = $route->getAttribute('resourceType'); if ($type === 'function') { - $utopia->getRoute()?->label('sdk.namespace', 'functions'); - $utopia->getRoute()?->label('sdk.method', 'createExecution'); + $method = $utopia->getRoute()?->getLabel('sdk', null); + + if (empty($method)) { + $utopia->getRoute()?->label('sdk', new Method( + namespace: 'functions', + name: 'createExecution', + description: '/docs/references/functions/create-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_EXECUTION, + ) + ], + responseType: ResponseType::MULTIPART, + requestType: 'application/json', + )); + } else { + /** @var Method $method */ + $method->setNamespace('functions'); + $method->setMethodName('createExecution'); + $utopia->getRoute()?->label('sdk', $method); + } if (System::getEnv('_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS if ($request->getProtocol() !== 'https') { diff --git a/docs/tutorials/add-route.md b/docs/tutorials/add-route.md index ac6fd40bdb..53926f7002 100644 --- a/docs/tutorials/add-route.md +++ b/docs/tutorials/add-route.md @@ -85,13 +85,19 @@ App::post('/v1/account/create') ```php App::post('/v1/account/jwt') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/account/create-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'account', + name: 'createJWT', + description: '/docs/references/account/create-jwt.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ], + responseType: ResponseType::JSON, + )) ``` #### Cache diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 6a809662d2..5032c6df53 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -211,6 +211,104 @@ class Method return $this->parameters; } + public function setNamespace(string $namespace): self + { + $this->namespace = $namespace; + return $this; + } + + public function setMethodName(string $name): self + { + $this->name = $name; + return $this; + } + + public function setDescription(string $description): self + { + $this->description = $description; + return $this; + } + + public function setAuth(array $auth): self + { + $this->validateAuthTypes($auth); + $this->auth = $auth; + return $this; + } + + /** + * @param Array $responses + */ + public function setResponses(array $responses): self + { + foreach ($responses as $response) { + $this->validateResponseModel($response->getModel()); + $this->validateNoContent($response); + } + $this->responses = $responses; + return $this; + } + + public function setResponseType(ResponseType $responseType): self + { + $this->responseType = $responseType; + return $this; + } + + public function setMethodType(?MethodType $methodType): self + { + $this->methodType = $methodType; + return $this; + } + + public function setOfflineKey(?string $offlineKey): self + { + $this->offlineKey = $offlineKey; + return $this; + } + + public function setOfflineModel(?string $offlineModel): self + { + $this->offlineModel = $offlineModel; + return $this; + } + + public function setOfflineResponseKey(?string $offlineResponseKey): self + { + $this->offlineResponseKey = $offlineResponseKey; + return $this; + } + + public function setDeprecated(bool $deprecated): self + { + $this->deprecated = $deprecated; + return $this; + } + + public function setHide(bool|array $hide): self + { + $this->hide = $hide; + return $this; + } + + public function setPackaging(bool $packaging): self + { + $this->packaging = $packaging; + return $this; + } + + public function setRequestType(string $requestType): self + { + $this->requestType = $requestType; + return $this; + } + + public function setParameters(array $parameters): self + { + $this->parameters = $parameters; + return $this; + } + // Throw any errors that were found during initialization public static function finaliseInitialization(): void { diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index 26c1baf188..a4fc0e0f63 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -28,8 +28,14 @@ class Request extends UtopiaRequest $parameters = parent::getParams(); if ($this->hasFilters() && self::hasRoute()) { - $method = self::getRoute()->getLabel('sdk.method', 'unknown'); - $endpointIdentifier = self::getRoute()->getLabel('sdk.namespace', 'unknown') . '.' . $method; + $method = self::getRoute()->getLabel('sdk', null); + /** @var \Appwrite\SDK\Method $method */ + + if (empty($method)) { + $endpointIdentifier = 'unknown.unknown'; + } else { + $endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName(); + } foreach ($this->getFilters() as $filter) { $parameters = $filter->parse($parameters, $endpointIdentifier); diff --git a/tests/unit/Utopia/RequestTest.php b/tests/unit/Utopia/RequestTest.php index 73daaa88bc..e19fdbe01f 100644 --- a/tests/unit/Utopia/RequestTest.php +++ b/tests/unit/Utopia/RequestTest.php @@ -2,6 +2,7 @@ namespace Tests\Unit\Utopia; +use Appwrite\SDK\Method; use Appwrite\Utopia\Request; use PHPUnit\Framework\TestCase; use Swoole\Http\Request as SwooleRequest; @@ -31,8 +32,13 @@ class RequestTest extends TestCase $this->assertCount(2, $this->request->getFilters()); $route = new Route(Request::METHOD_GET, '/test'); - $route->label('sdk.method', 'method'); - $route->label('sdk.namespace', 'namespace'); + $route->label('sdk', new Method( + namespace: 'namespace', + name: 'method', + description: 'description', + auth: [], + responses: [], + )); // set test header to prevent header populaten inside the request class $this->request->addHeader('EXAMPLE', 'VALUE'); $this->request->setRoute($route); From d54d0ea7b3b93854b3fec7880ee134db80129ca5 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Mon, 13 Jan 2025 09:35:05 +0900 Subject: [PATCH 17/29] Address error validation comment --- app/http.php | 6 +++++- src/Appwrite/SDK/Method.php | 7 ++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/http.php b/app/http.php index 42a9010482..1ef4dcd282 100644 --- a/app/http.php +++ b/app/http.php @@ -336,5 +336,9 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } }); -Method::finaliseInitialization(); +// Check for any errors found while we were initialising the SDK Methods. +if (!empty(Method::getErrors())) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); +} + $http->start(); diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 5032c6df53..ffcafb984b 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -309,11 +309,8 @@ class Method return $this; } - // Throw any errors that were found during initialization - public static function finaliseInitialization(): void + public static function getErrors(): array { - if (!empty(self::$errors)) { - throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, self::$errors)); - } + return self::$errors; } } From efd8dc16b342b4d80a90b3336574724df1590df7 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 14 Jan 2025 17:52:31 +0900 Subject: [PATCH 18/29] Address Comments --- app/config/specs/swagger2-latest-client.json | 18 +++++++----------- app/config/specs/swagger2-latest-console.json | 18 +++++++----------- app/config/specs/swagger2-latest-server.json | 18 +++++++----------- app/controllers/api/databases.php | 8 ++++---- app/controllers/api/graphql.php | 4 ++-- src/Appwrite/SDK/Method.php | 9 ++++++++- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 7 files changed, 36 insertions(+), 41 deletions(-) diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 65e28ff79d..80f3eb574f 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4806,14 +4806,14 @@ "properties": { "documentId": { "type": "string", - "description": "", - "default": null, + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", "x-example": "" }, "data": { "type": "object", - "description": "", - "default": {}, + "description": "Document data as JSON object.", + "default": [], "x-example": "{}" }, "documents": { @@ -4827,18 +4827,14 @@ }, "permissions": { "type": "array", - "description": "", - "default": [], + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 5ac694787c..aace6f890d 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -8390,14 +8390,14 @@ "properties": { "documentId": { "type": "string", - "description": "", - "default": null, + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", "x-example": "" }, "data": { "type": "object", - "description": "", - "default": {}, + "description": "Document data as JSON object.", + "default": [], "x-example": "{}" }, "documents": { @@ -8411,18 +8411,14 @@ }, "permissions": { "type": "array", - "description": "", - "default": [], + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 64544d2a03..6db78641e8 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -7904,14 +7904,14 @@ "properties": { "documentId": { "type": "string", - "description": "", - "default": null, + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", "x-example": "" }, "data": { "type": "object", - "description": "", - "default": {}, + "description": "Document data as JSON object.", + "default": [], "x-example": "{}" }, "documents": { @@ -7925,18 +7925,14 @@ }, "permissions": { "type": "array", - "description": "", - "default": [], + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, "x-example": "[\"read(\"any\")\"]", "items": { "type": "string" } } - }, - "required": [ - "documentId", - "data" - ] + } } } ] diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index e0f441ed64..f6054ee37b 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3111,9 +3111,9 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') offlineKey: '{documentId}', offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ - 'documentId' => ['default' => [], 'validator' => new CustomId(), 'description' => '', 'optional' => false], - 'data' => ['default' => [], 'validator' => new JSON(), 'description' => '', 'optional' => false], - 'permissions' => ['default' => [], 'validator' => new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'description' => '', 'optional' => true], + 'documentId' => ['optional' => false], + 'data' => ['optional' => false], + 'permissions' => ['optional' => true], ] ), new Method( @@ -3131,7 +3131,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') offlineKey: '{documentId}', offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ - 'documents' => ['default' => [], 'validator' => new ArrayList(new JSON(), APP_LIMIT_ARRAY_DOCUMENTS_SIZE), 'description' => '', 'optional' => false], + 'documents' => ['optional' => false], ] ) ] diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 1f4e4e334a..62a7c72d61 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -100,7 +100,7 @@ App::post('/v1/graphql/mutation') ) ], methodType: MethodType::GRAPHQL, - parameters: [ + additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], )) @@ -150,7 +150,7 @@ App::post('/v1/graphql') ) ], methodType: MethodType::GRAPHQL, - parameters: [ + additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], )) diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index ffcafb984b..34ac15328c 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -30,6 +30,7 @@ class Method * @param bool $packaging * @param string $requestType * @param array $parameters + * @param array $additionalParameters * * @throws \Exception */ @@ -48,7 +49,8 @@ class Method protected array|bool $hide = false, protected bool $packaging = false, protected string $requestType = 'application/json', - protected array $parameters = [] + protected array $parameters = [], + protected array $additionalParameters = [] ) { $this->validateMethod($name, $namespace); $this->validateAuthTypes($auth); @@ -211,6 +213,11 @@ class Method return $this->parameters; } + public function getAdditionalParameters(): array + { + return $this->additionalParameters; + } + public function setNamespace(string $namespace): self { $this->namespace = $namespace; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 59e5b96106..461feb844c 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -330,7 +330,7 @@ class Swagger2 extends Format $parameters = \array_merge( $route->getParams(), - $sdk->getParameters() ?? [], + $sdk->getAdditionalParameters() ?? [], ); foreach ($parameters as $name => $param) { // Set params From ec44b1f272fbd2c97ae989af3bf23de07d0e42c1 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 14 Jan 2025 18:09:37 +0900 Subject: [PATCH 19/29] Make all delete routes return none --- app/config/specs/open-api3-latest-client.json | 2 +- .../specs/open-api3-latest-console.json | 8 +- app/config/specs/open-api3-latest-server.json | 4 +- app/config/specs/swagger2-latest-client.json | 44 ++--- app/config/specs/swagger2-latest-console.json | 160 +++++------------- app/config/specs/swagger2-latest-server.json | 112 +++--------- app/controllers/api/account.php | 13 +- app/controllers/api/databases.php | 12 +- app/controllers/api/functions.php | 12 +- app/controllers/api/messaging.php | 13 +- app/controllers/api/migrations.php | 4 +- app/controllers/api/project.php | 4 +- app/controllers/api/projects.php | 19 ++- app/controllers/api/proxy.php | 4 +- app/controllers/api/storage.php | 6 +- app/controllers/api/teams.php | 7 +- app/controllers/api/users.php | 19 ++- app/controllers/api/vcs.php | 3 +- 18 files changed, 162 insertions(+), 284 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 9164bb0a7f..9fa6b2250d 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4770,7 +4770,7 @@ "200": { "description": "Documents List", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/documentList" } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 484b25e18e..f69352220a 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -8339,7 +8339,7 @@ "200": { "description": "Documents List", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -23551,7 +23551,7 @@ "200": { "description": "EmailTemplate", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/emailTemplate" } @@ -24244,7 +24244,7 @@ "200": { "description": "SmsTemplate", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/smsTemplate" } @@ -29480,7 +29480,7 @@ "200": { "description": "User", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/user" } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 0656264d09..b424630cbc 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7877,7 +7877,7 @@ "200": { "description": "Documents List", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -21141,7 +21141,7 @@ "200": { "description": "User", "content": { - "application\/json": { + "": { "schema": { "$ref": "#\/components\/schemas\/user" } diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 80f3eb574f..b414baf7a5 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -367,9 +367,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -780,9 +778,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -1815,9 +1811,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2501,9 +2495,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2783,9 +2775,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -4950,9 +4940,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -5238,9 +5226,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -6289,9 +6275,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -6708,9 +6692,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -7445,9 +7427,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -7875,9 +7855,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index aace6f890d..bc1450a9db 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -225,9 +225,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -423,9 +421,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -831,9 +827,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -1852,9 +1846,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2535,9 +2527,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2813,9 +2803,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -5161,9 +5149,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -5589,9 +5575,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8035,9 +8019,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8534,9 +8516,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8822,9 +8802,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -9270,9 +9248,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -10670,9 +10646,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -11044,9 +11018,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -11615,9 +11587,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -12076,9 +12046,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -15189,9 +15157,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17804,9 +17770,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18332,9 +18296,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18714,9 +18676,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -20057,9 +20017,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "migrations" ], @@ -20475,9 +20433,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "project" ], @@ -20951,9 +20907,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -22435,9 +22389,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -22999,9 +22951,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -24086,9 +24036,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -24766,9 +24714,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -25365,9 +25311,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "projects" ], @@ -25726,9 +25670,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "proxy" ], @@ -26263,9 +26205,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -26670,9 +26610,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -27563,9 +27501,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -28067,9 +28003,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -28812,9 +28746,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -29549,9 +29481,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -30077,9 +30007,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -30908,9 +30836,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -30968,9 +30894,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -31473,9 +31397,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -32468,9 +32390,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "vcs" ], diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 6db78641e8..29030aef75 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -385,9 +385,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -803,9 +801,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -1852,9 +1848,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -2406,9 +2400,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], @@ -4642,9 +4634,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -5075,9 +5065,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -7543,9 +7531,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8050,9 +8036,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8344,9 +8328,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -8707,9 +8689,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "databases" ], @@ -9552,9 +9532,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -9931,9 +9909,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -10512,9 +10488,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -10896,9 +10870,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "functions" ], @@ -14061,9 +14033,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -16701,9 +16671,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17236,9 +17204,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17624,9 +17590,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18118,9 +18082,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -18534,9 +18496,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "storage" ], @@ -19287,9 +19247,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -19727,9 +19685,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "teams" ], @@ -20485,9 +20441,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -21155,9 +21109,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -21690,9 +21642,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -22533,9 +22483,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -22594,9 +22542,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -23105,9 +23051,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 283cf2d8ea..cab34858e3 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -469,7 +469,7 @@ App::delete('/v1/account') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->inject('user') ->inject('project') @@ -571,7 +571,7 @@ App::delete('/v1/account/sessions') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->label('abuse-limit', 100) ->inject('request') @@ -695,7 +695,7 @@ App::delete('/v1/account/sessions/:sessionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->label('abuse-limit', 100) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.') @@ -2008,6 +2008,7 @@ App::post('/v1/account/tokens/magic-url') $senderEmail = System::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM); $senderName = System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'); + $replyTo = ""; if ($smtpEnabled) { @@ -4230,7 +4231,7 @@ App::delete('/v1/account/mfa/authenticators/:type') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -4706,7 +4707,7 @@ App::delete('/v1/account/targets/:targetId/push') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -4828,7 +4829,7 @@ App::delete('/v1/account/identities/:identityId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index f6054ee37b..7497e93780 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -785,7 +785,7 @@ App::delete('/v1/databases/:databaseId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -1204,7 +1204,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -2604,7 +2604,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3030,7 +3030,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4192,7 +4192,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu model: Response::MODEL_NONE, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' )) @@ -4317,7 +4317,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, + responseType: ResponseType::NONE, offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', offlineKey: '{documentId}' )) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 8d79ecd40e..8c125e5c13 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1188,7 +1188,8 @@ App::delete('/v1/functions/:functionId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -1605,7 +1606,8 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -2404,7 +2406,8 @@ App::delete('/v1/functions/:functionId/executions/:executionId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2700,7 +2703,8 @@ App::delete('/v1/functions/:functionId/variables/:variableId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 44e77c953d..7a1bbc5994 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -14,6 +14,7 @@ use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -2050,7 +2051,8 @@ App::delete('/v1/messaging/providers/:providerId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') @@ -2378,7 +2380,8 @@ App::delete('/v1/messaging/topics/:topicId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') @@ -2751,7 +2754,8 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -4152,7 +4156,8 @@ App::delete('/v1/messaging/messages/:messageId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index e41c23da69..71156df789 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -10,6 +10,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -1143,7 +1144,8 @@ App::delete('/v1/migrations/:migrationId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 3356497a13..0ad69ab1ec 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -4,6 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; @@ -501,7 +502,8 @@ App::delete('/v1/project/variables/:variableId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index c1251ecd8b..451e732306 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -13,6 +13,7 @@ use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -1083,7 +1084,8 @@ App::delete('/v1/projects/:projectId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1377,7 +1379,8 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1609,7 +1612,8 @@ App::delete('/v1/projects/:projectId/keys/:keyId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1885,7 +1889,8 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -2300,7 +2305,8 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') code: Response::STATUS_CODE_OK, model: Response::MODEL_SMS_TEMPLATE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2349,7 +2355,8 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') code: Response::STATUS_CODE_OK, model: Response::MODEL_EMAIL_TEMPLATE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 2476bfdaba..e3917acc02 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -8,6 +8,7 @@ use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -279,7 +280,8 @@ App::delete('/v1/proxy/rules/:ruleId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 59e831f057..b2a3f23dfb 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -339,7 +339,8 @@ App::delete('/v1/storage/buckets/:bucketId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -1672,7 +1673,8 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index f364e4d871..67b297bd87 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -14,6 +14,7 @@ use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -382,7 +383,8 @@ App::delete('/v1/teams/:teamId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -1221,7 +1223,8 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index c9fc6a5cd0..04d8952d3a 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -18,6 +18,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\SDK\ResponseType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -1905,7 +1906,8 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') code: Response::STATUS_CODE_OK, model: Response::MODEL_USER, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') @@ -2087,7 +2089,8 @@ App::delete('/v1/users/:userId/sessions/:sessionId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') @@ -2136,7 +2139,8 @@ App::delete('/v1/users/:userId/sessions') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2184,7 +2188,8 @@ App::delete('/v1/users/:userId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2232,7 +2237,8 @@ App::delete('/v1/users/:userId/targets/:targetId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -2288,7 +2294,8 @@ App::delete('/v1/users/identities/:identityId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE, )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 3e31908bf9..2c4424a348 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -1191,7 +1191,8 @@ App::delete('/v1/vcs/installations/:installationId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ] + ], + responseType: ResponseType::NONE )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') From bc85d04bbc8713b9a93c4a1dfc901e96e1a7d69c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 14 Jan 2025 18:10:27 +0900 Subject: [PATCH 20/29] Run Linter --- app/controllers/api/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 04d8952d3a..64b7f5dbc8 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -2294,7 +2294,7 @@ App::delete('/v1/users/identities/:identityId') code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE, ) - ], + ], responseType: ResponseType::NONE, )) ->param('identityId', '', new UID(), 'Identity ID.') From 396602d8871989e355fe31093b3c9b5b72d6c942 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 09:58:57 +0900 Subject: [PATCH 21/29] Address Comments --- app/controllers/api/account.php | 64 +++++-------------- app/controllers/api/databases.php | 28 ++------ app/controllers/api/locale.php | 32 +++------- app/controllers/api/teams.php | 24 ++----- docker-compose.yml | 2 +- src/Appwrite/SDK/Method.php | 39 ----------- .../Specification/Format/OpenAPI3.php | 5 +- .../Specification/Format/Swagger2.php | 5 +- 8 files changed, 41 insertions(+), 158 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index cab34858e3..8e29b02518 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -438,9 +438,7 @@ App::get('/v1/account') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current' + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -522,7 +520,6 @@ App::get('/v1/account/sessions') ) ], responseType: ResponseType::JSON, - offlineModel: '/account/sessions' )) ->inject('response') ->inject('user') @@ -640,9 +637,7 @@ App::get('/v1/account/sessions/:sessionId') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/sessions', - offlineKey: '{sessionId}' + responseType: ResponseType::JSON )) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.') ->inject('response') @@ -2652,9 +2647,7 @@ App::get('/v1/account/prefs') model: Response::MODEL_PREFERENCES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/prefs', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -2754,9 +2747,7 @@ App::patch('/v1/account/name') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') ->inject('requestTimestamp') @@ -2794,9 +2785,7 @@ App::patch('/v1/account/password') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->label('abuse-limit', 10) ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) @@ -2869,9 +2858,7 @@ App::patch('/v1/account/email') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -2967,9 +2954,7 @@ App::patch('/v1/account/phone') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -3054,9 +3039,7 @@ App::patch('/v1/account/prefs') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/prefs', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') ->inject('requestTimestamp') @@ -3854,9 +3837,7 @@ App::patch('/v1/account/mfa') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('requestTimestamp') @@ -3909,9 +3890,7 @@ App::get('/v1/account/mfa/factors') model: Response::MODEL_MFA_FACTORS, ) ], - responseType: ResponseType::JSON, - offlineKey: 'current', - offlineModel: '/account' + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -3951,9 +3930,7 @@ App::post('/v1/account/mfa/authenticators/:type') model: Response::MODEL_MFA_TYPE, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current' + responseType: ResponseType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') @@ -4029,9 +4006,7 @@ App::put('/v1/account/mfa/authenticators/:type') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current' + responseType: ResponseType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') @@ -4100,9 +4075,7 @@ App::post('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -4148,9 +4121,7 @@ App::patch('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('dbForProject') ->inject('response') @@ -4191,9 +4162,7 @@ App::get('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account', - offlineKey: 'current', + responseType: ResponseType::JSON )) ->inject('response') ->inject('user') @@ -4757,8 +4726,7 @@ App::get('/v1/account/identities') model: Response::MODEL_IDENTITY_LIST, ) ], - responseType: ResponseType::JSON, - offlineModel: '/account/identities', + responseType: ResponseType::JSON )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->inject('response') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 7497e93780..825b4601e9 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3108,8 +3108,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ) ], responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ 'documentId' => ['optional' => false], 'data' => ['optional' => false], @@ -3124,12 +3122,10 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') responses: [ new SDKResponse( code: Response::STATUS_CODE_CREATED, - model: Response::MODEL_DOCUMENT, + model: Response::MODEL_DOCUMENT_LIST, ) ], responseType: ResponseType::JSON, - offlineKey: '{documentId}', - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', parameters: [ 'documents' => ['optional' => false], ] @@ -3429,8 +3425,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3590,9 +3585,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3806,9 +3799,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4049,8 +4040,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', + responseType: ResponseType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4192,9 +4182,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4317,9 +4305,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::NONE, - offlineModel: '/databases/{databaseId}/collections/{collectionId}/documents', - offlineKey: '{documentId}' + responseType: ResponseType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 28defca386..5b4c1ac47f 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -25,9 +25,7 @@ App::get('/v1/locale') code: Response::STATUS_CODE_OK, model: Response::MODEL_LOCALE, ) - ], - offlineKey: 'current', - offlineModel: '/localed', + ] )) ->inject('request') ->inject('response') @@ -90,9 +88,7 @@ App::get('/v1/locale/codes') code: Response::STATUS_CODE_OK, model: Response::MODEL_LOCALE_CODE_LIST, ) - ], - offlineKey: 'current', - offlineModel: '/locale/localeCode', + ] )) ->inject('response') ->action(function (Response $response) { @@ -117,9 +113,7 @@ App::get('/v1/locale/countries') code: Response::STATUS_CODE_OK, model: Response::MODEL_COUNTRY_LIST, ) - ], - offlineModel: '/locale/countries', - offlineResponseKey: 'code' + ] )) ->inject('response') ->inject('locale') @@ -155,9 +149,7 @@ App::get('/v1/locale/countries/eu') code: Response::STATUS_CODE_OK, model: Response::MODEL_COUNTRY_LIST, ) - ], - offlineModel: '/locale/countries/eu', - offlineResponseKey: 'code' + ] )) ->inject('response') ->inject('locale') @@ -195,9 +187,7 @@ App::get('/v1/locale/countries/phones') code: Response::STATUS_CODE_OK, model: Response::MODEL_PHONE_LIST, ) - ], - offlineModel: '/locale/countries/phones', - offlineResponseKey: 'countryCode' + ] )) ->inject('response') ->inject('locale') @@ -234,9 +224,7 @@ App::get('/v1/locale/continents') code: Response::STATUS_CODE_OK, model: Response::MODEL_CONTINENT_LIST, ) - ], - offlineModel: '/locale/continents', - offlineResponseKey: 'code' + ] )) ->inject('response') ->inject('locale') @@ -271,9 +259,7 @@ App::get('/v1/locale/currencies') code: Response::STATUS_CODE_OK, model: Response::MODEL_CURRENCY_LIST, ) - ], - offlineModel: '/locale/currencies', - offlineResponseKey: 'code' + ] )) ->inject('response') ->action(function (Response $response) { @@ -299,9 +285,7 @@ App::get('/v1/locale/languages') code: Response::STATUS_CODE_OK, model: Response::MODEL_LANGUAGE_LIST, ) - ], - offlineModel: '/locale/languages', - offlineResponseKey: 'code' + ] )) ->inject('response') ->action(function (Response $response) { diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 67b297bd87..2cc88e11a7 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -157,8 +157,7 @@ App::get('/v1/teams') code: Response::STATUS_CODE_OK, model: Response::MODEL_TEAM_LIST, ) - ], - offlineModel: '/teams', + ] )) ->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -226,9 +225,7 @@ App::get('/v1/teams/:teamId') code: Response::STATUS_CODE_OK, model: Response::MODEL_TEAM, ) - ], - offlineModel: '/teams', - offlineKey: '{teamId}', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -258,8 +255,7 @@ App::get('/v1/teams/:teamId/prefs') code: Response::STATUS_CODE_OK, model: Response::MODEL_PREFERENCES, ) - ], - offlineModel: '/teams/{teamId}/prefs', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -294,9 +290,7 @@ App::put('/v1/teams/:teamId') code: Response::STATUS_CODE_OK, model: Response::MODEL_TEAM, ) - ], - offlineModel: '/teams', - offlineKey: '{teamId}', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('name', null, new Text(128), 'New team name. Max length: 128 chars.') @@ -343,8 +337,7 @@ App::put('/v1/teams/:teamId/prefs') code: Response::STATUS_CODE_OK, model: Response::MODEL_PREFERENCES, ) - ], - offlineModel: '/teams/{teamId}/prefs', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') @@ -771,8 +764,7 @@ App::get('/v1/teams/:teamId/memberships') code: Response::STATUS_CODE_OK, model: Response::MODEL_MEMBERSHIP_LIST, ) - ], - offlineModel: '/teams/{teamId}/memberships', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true) @@ -907,9 +899,7 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') code: Response::STATUS_CODE_OK, model: Response::MODEL_MEMBERSHIP, ) - ], - offlineModel: '/teams/{teamId}/memberships', - offlineKey: '{membershipId}', + ] )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') diff --git a/docker-compose.yml b/docker-compose.yml index 048178e60a..e104cfcbec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,7 +49,7 @@ services: build: context: . args: - DEBUG: false + DEBUG: true TESTING: true VERSION: dev ports: diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 34ac15328c..c1c4a3e6e2 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -22,9 +22,6 @@ class Method * @param array $responses * @param ResponseType $responseType * @param MethodType|null $methodType - * @param string|null $offlineKey - * @param string|null $offlineModel - * @param string|null $offlineResponseKey * @param bool $deprecated * @param array|bool $hide * @param bool $packaging @@ -42,9 +39,6 @@ class Method protected array $responses, protected ResponseType $responseType = ResponseType::JSON, protected ?MethodType $methodType = null, - protected ?string $offlineKey = null, - protected ?string $offlineModel = null, - protected ?string $offlineResponseKey = null, protected bool $deprecated = false, protected array|bool $hide = false, protected bool $packaging = false, @@ -173,21 +167,6 @@ class Method return $this->methodType; } - public function getOfflineKey(): ?string - { - return $this->offlineKey; - } - - public function getOfflineModel(): ?string - { - return $this->offlineModel; - } - - public function getOfflineResponseKey(): ?string - { - return $this->offlineResponseKey; - } - public function isDeprecated(): bool { return $this->deprecated; @@ -268,24 +247,6 @@ class Method return $this; } - public function setOfflineKey(?string $offlineKey): self - { - $this->offlineKey = $offlineKey; - return $this; - } - - public function setOfflineModel(?string $offlineModel): self - { - $this->offlineModel = $offlineModel; - return $this; - } - - public function setOfflineResponseKey(?string $offlineResponseKey): self - { - $this->offlineResponseKey = $offlineResponseKey; - return $this; - } - public function setDeprecated(bool $deprecated): self { $this->deprecated = $deprecated; diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 9abf94e6c2..3c8df24e48 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -196,10 +196,7 @@ class OpenAPI3 extends Format 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $sdk->isPackaging(), - 'offline-model' => $sdk->getOfflineModel() ?? '', - 'offline-key' => $sdk->getOfflineKey() ?? '', - 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', + 'packaging' => $sdk->isPackaging() ], ]; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 461feb844c..d07d64d66a 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -194,10 +194,7 @@ class Swagger2 extends Format 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $sdk->isPackaging(), - 'offline-model' => $sdk->getOfflineModel() ?? '', - 'offline-key' => $sdk->getOfflineKey() ?? '', - 'offline-response-key' => $sdk->getOfflineResponseKey() ?? '$id', + 'packaging' => $sdk->isPackaging() ], ]; From 8d7712a669d63c035f8c9933d1d4a750d93b177c Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 09:59:16 +0900 Subject: [PATCH 22/29] Remove debug flag --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e104cfcbec..048178e60a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,7 +49,7 @@ services: build: context: . args: - DEBUG: true + DEBUG: false TESTING: true VERSION: dev ports: From d6474a85e296c741e0770f4eeb2c232a4f81bf88 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 12:54:49 +0900 Subject: [PATCH 23/29] Address Comments --- app/config/specs/open-api3-latest-client.json | 296 +---- .../specs/open-api3-latest-console.json | 1127 +--------------- app/config/specs/open-api3-latest-server.json | 811 +----------- app/config/specs/swagger2-latest-client.json | 301 +---- app/config/specs/swagger2-latest-console.json | 1132 +---------------- app/config/specs/swagger2-latest-server.json | 812 +----------- app/controllers/api/account.php | 102 +- app/controllers/api/avatars.php | 30 +- app/controllers/api/console.php | 6 +- app/controllers/api/databases.php | 80 +- app/controllers/api/functions.php | 18 +- app/controllers/api/graphql.php | 4 +- app/controllers/api/health.php | 48 +- app/controllers/api/messaging.php | 10 +- app/controllers/api/migrations.php | 6 +- app/controllers/api/project.php | 4 +- app/controllers/api/projects.php | 14 +- app/controllers/api/proxy.php | 4 +- app/controllers/api/storage.php | 20 +- app/controllers/api/teams.php | 6 +- app/controllers/api/users.php | 18 +- app/controllers/api/vcs.php | 8 +- app/controllers/general.php | 4 +- .../SDK/{ResponseType.php => ContentType.php} | 2 +- src/Appwrite/SDK/Method.php | 22 +- src/Appwrite/SDK/Response.php | 8 +- .../Specification/Format/OpenAPI3.php | 7 +- .../Specification/Format/Swagger2.php | 10 +- 28 files changed, 252 insertions(+), 4658 deletions(-) rename src/Appwrite/SDK/{ResponseType.php => ContentType.php} (91%) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 9fa6b2250d..985e6e104b 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -109,9 +106,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -196,9 +190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -274,9 +265,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -335,9 +323,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -400,9 +385,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -451,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -519,9 +498,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -591,9 +567,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -659,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -739,9 +709,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -809,9 +776,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -885,9 +849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -963,9 +924,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1016,9 +974,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1067,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1118,9 +1070,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1171,9 +1120,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1243,9 +1189,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1320,9 +1263,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1398,9 +1338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1449,9 +1386,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1524,9 +1458,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1600,9 +1531,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1684,9 +1612,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1728,9 +1653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1781,9 +1703,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1832,9 +1751,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1908,9 +1824,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1977,9 +1890,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2120,9 +2030,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2196,9 +2103,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2272,9 +2176,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2335,9 +2236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2391,9 +2289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2456,9 +2351,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2508,9 +2400,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2589,9 +2478,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2662,9 +2548,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2726,9 +2609,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2810,9 +2690,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2889,9 +2766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3035,9 +2909,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3111,9 +2982,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3181,9 +3049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3262,9 +3127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3313,9 +3175,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3385,9 +3244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3513,9 +3369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3645,9 +3498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3705,9 +3555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4195,9 +4042,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4279,9 +4123,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4373,9 +4214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4474,9 +4312,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4561,9 +4396,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -4576,8 +4408,7 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/components\/schemas\/document" + "model": "#\/components\/schemas\/documentList" } ] } @@ -4690,9 +4521,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4770,7 +4598,7 @@ "200": { "description": "Documents List", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -4796,9 +4624,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4891,9 +4716,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4988,9 +4810,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5089,9 +4908,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5175,9 +4991,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5263,9 +5076,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5380,9 +5190,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5456,9 +5263,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5510,9 +5314,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5564,9 +5365,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5618,9 +5416,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5672,9 +5467,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5726,9 +5518,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5780,9 +5569,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5834,9 +5620,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -5888,9 +5671,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5942,9 +5722,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5997,9 +5774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6082,9 +5856,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6158,9 +5929,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6246,9 +6014,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6346,9 +6111,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6420,9 +6182,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6511,9 +6270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6580,9 +6336,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6649,9 +6402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6867,9 +6617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6943,9 +6690,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7021,9 +6765,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7108,9 +6849,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7172,9 +6910,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7248,9 +6983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7314,9 +7046,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7402,9 +7131,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7515,9 +7241,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7589,9 +7312,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7678,9 +7398,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7753,9 +7470,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7853,9 +7567,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7916,9 +7627,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index f69352220a..98699ace10 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -108,9 +105,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -185,9 +179,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -236,9 +227,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -313,9 +301,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -373,9 +358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -437,9 +419,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -488,9 +467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -555,9 +531,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -626,9 +599,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -693,9 +663,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -772,9 +739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -841,9 +805,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -917,9 +878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -994,9 +952,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1046,9 +1001,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1096,9 +1048,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1146,9 +1095,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1198,9 +1144,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1269,9 +1212,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1345,9 +1285,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1422,9 +1359,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1472,9 +1406,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1546,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1621,9 +1549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1704,9 +1629,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1747,9 +1669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1799,9 +1718,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1850,9 +1766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1926,9 +1839,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1995,9 +1905,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2138,9 +2045,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2214,9 +2118,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2290,9 +2191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2352,9 +2250,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2407,9 +2302,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2471,9 +2363,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2522,9 +2411,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2602,9 +2488,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2674,9 +2557,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2737,9 +2617,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2821,9 +2698,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2900,9 +2774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3046,9 +2917,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3122,9 +2990,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3191,9 +3056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3271,9 +3133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3321,9 +3180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3392,9 +3248,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3520,9 +3373,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3652,9 +3502,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3712,9 +3559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4202,9 +4046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4286,9 +4127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4380,9 +4218,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4472,9 +4307,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4541,9 +4373,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4591,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4666,9 +4492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4747,9 +4570,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4821,9 +4641,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4882,9 +4699,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4960,9 +4774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5023,9 +4834,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5108,9 +4916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5214,9 +5019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5285,9 +5087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5386,9 +5185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5459,9 +5255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5545,9 +5338,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5653,9 +5443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5766,9 +5553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5874,9 +5658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5987,9 +5768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6095,9 +5873,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6208,9 +5983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6325,9 +6097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6447,9 +6216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6565,9 +6331,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6690,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6808,9 +6568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6933,9 +6690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7041,9 +6795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7154,9 +6905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7287,9 +7035,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7406,9 +7151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7524,9 +7266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7632,9 +7371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7776,9 +7512,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7849,9 +7582,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7931,9 +7661,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8043,9 +7770,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8130,9 +7854,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -8145,8 +7866,7 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/components\/schemas\/document" + "model": "#\/components\/schemas\/documentList" } ] } @@ -8259,9 +7979,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8339,7 +8056,7 @@ "200": { "description": "Documents List", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -8365,9 +8082,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8460,9 +8174,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8557,9 +8268,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8658,9 +8366,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8742,9 +8447,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8837,9 +8539,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8921,9 +8620,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9043,9 +8739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9116,9 +8809,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9198,9 +8888,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9283,9 +8970,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9377,9 +9061,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9452,9 +9133,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9536,9 +9214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9611,9 +9286,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9860,9 +9532,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9912,9 +9581,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9963,9 +9629,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10065,9 +9728,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10127,9 +9787,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10201,9 +9858,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10262,9 +9916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10488,9 +10139,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10551,9 +10199,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10636,9 +10281,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10734,9 +10376,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10805,9 +10444,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10869,9 +10505,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10935,9 +10568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11022,9 +10652,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11089,9 +10716,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11165,9 +10789,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11253,9 +10874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11370,9 +10988,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11435,9 +11050,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11508,9 +11120,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11592,9 +11201,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11653,9 +11259,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11741,9 +11344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11812,9 +11412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11900,9 +11497,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11975,9 +11569,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12029,9 +11620,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12081,9 +11669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12132,9 +11717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12183,9 +11765,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12234,9 +11813,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12296,9 +11872,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12347,9 +11920,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12398,9 +11968,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12449,9 +12016,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12513,9 +12077,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12577,9 +12138,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12652,9 +12210,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12716,9 +12271,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12806,9 +12358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12870,9 +12419,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12934,9 +12480,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12998,9 +12541,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13062,9 +12602,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13126,9 +12663,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13190,9 +12724,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13254,9 +12785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13318,9 +12846,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13369,9 +12894,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13420,9 +12942,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13473,9 +12992,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13527,9 +13043,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13581,9 +13094,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13635,9 +13145,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13689,9 +13196,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13743,9 +13247,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -13797,9 +13298,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13851,9 +13349,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13904,9 +13399,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13982,9 +13474,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14128,9 +13617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14276,9 +13762,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14433,9 +13916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14592,9 +14072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14703,9 +14180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14817,9 +14291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14872,9 +14343,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14936,9 +14404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15013,9 +14478,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15090,9 +14552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15168,9 +14627,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15275,9 +14731,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15385,9 +14838,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15472,9 +14922,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15562,9 +15009,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15679,9 +15123,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15799,9 +15240,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15896,9 +15334,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15996,9 +15431,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16103,9 +15535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16213,9 +15642,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16358,9 +15784,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16505,9 +15928,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16602,9 +16022,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16702,9 +16119,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16799,9 +16213,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16899,9 +16310,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16996,9 +16404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17096,9 +16501,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17193,9 +16595,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17293,9 +16692,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17348,9 +16744,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17412,9 +16805,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17489,9 +16879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17566,9 +16953,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17642,9 +17026,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17727,9 +17108,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17789,9 +17167,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17868,9 +17243,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17932,9 +17304,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18009,9 +17378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18097,9 +17463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18187,9 +17550,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18254,9 +17614,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18328,9 +17685,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18404,9 +17758,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18494,9 +17845,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18589,9 +17937,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18660,9 +18005,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18710,9 +18052,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18788,9 +18127,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18838,9 +18174,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18912,9 +18245,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18986,9 +18316,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19099,9 +18426,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19234,9 +18558,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19341,9 +18662,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19467,9 +18785,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19527,9 +18842,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19580,9 +18892,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19642,9 +18951,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19732,9 +19038,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19780,9 +19083,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19855,9 +19155,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19915,9 +19212,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19992,9 +19286,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20054,9 +19345,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20128,9 +19416,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20265,9 +19550,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20325,9 +19607,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20442,9 +19721,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20504,9 +19780,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20598,9 +19871,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20679,9 +19949,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20760,9 +20027,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20841,9 +20105,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20922,9 +20183,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21015,9 +20273,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21099,9 +20354,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21180,9 +20432,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21261,9 +20510,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21342,9 +20588,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21423,9 +20666,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21525,9 +20765,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21614,9 +20851,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21674,9 +20908,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21769,9 +21000,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21839,9 +21067,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21935,9 +21160,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22007,9 +21229,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22146,9 +21365,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22206,9 +21422,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22327,9 +21540,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22397,9 +21607,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22494,9 +21701,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22566,9 +21770,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22668,9 +21869,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22749,9 +21947,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22869,9 +22064,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23002,9 +22194,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23083,9 +22272,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23309,9 +22495,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23551,7 +22734,7 @@ "200": { "description": "EmailTemplate", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/emailTemplate" } @@ -23575,9 +22758,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23803,9 +22983,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24026,9 +23203,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24244,7 +23418,7 @@ "200": { "description": "SmsTemplate", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/smsTemplate" } @@ -24268,9 +23442,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24493,9 +23664,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24553,9 +23721,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24670,9 +23835,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24740,9 +23902,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24858,9 +24017,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24930,9 +24086,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25002,9 +24155,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25076,9 +24226,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25162,9 +24309,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25215,9 +24359,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25277,9 +24418,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25339,9 +24477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25414,9 +24549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25543,9 +24675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25604,9 +24733,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25730,9 +24856,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25795,9 +24918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25883,9 +25003,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25983,9 +25100,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26057,9 +25171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26148,9 +25259,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26217,9 +25325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26286,9 +25391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26504,9 +25606,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26578,9 +25677,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26652,9 +25748,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26738,9 +25831,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26816,9 +25906,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26903,9 +25990,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26967,9 +26051,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27043,9 +26124,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27107,9 +26185,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27184,9 +26259,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27272,9 +26344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27385,9 +26454,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27459,9 +26525,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27548,9 +26611,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27623,9 +26683,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27722,9 +26779,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27784,9 +26838,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27866,9 +26917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27941,9 +26989,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28031,9 +27076,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28118,9 +27160,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28205,9 +27244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28275,9 +27311,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28338,9 +27371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28425,9 +27455,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28512,9 +27539,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28629,9 +27653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28734,9 +27755,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28841,9 +27859,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28915,9 +27930,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28969,9 +27981,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29032,9 +28041,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29114,9 +28120,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29198,9 +28201,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29283,9 +28283,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29359,9 +28356,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29422,9 +28416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29477,15 +28468,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -29504,9 +28488,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29582,9 +28563,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29645,9 +28623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29706,9 +28681,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29767,9 +28739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29830,9 +28799,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29912,9 +28878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29994,9 +28957,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30076,9 +29036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30137,9 +29094,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30219,9 +29173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30280,9 +29231,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30334,9 +29282,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30390,9 +29335,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30463,9 +29405,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30546,9 +29485,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30621,9 +29557,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30733,9 +29666,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30805,9 +29735,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30896,9 +29823,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30969,9 +29893,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31053,9 +29974,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31135,9 +30053,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31217,9 +30132,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31288,9 +30200,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31375,9 +30284,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31447,9 +30353,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31519,9 +30422,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31602,9 +30502,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31683,9 +30580,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31774,9 +30668,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31850,9 +30741,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31903,9 +30791,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index b424630cbc..647b43fc8a 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -110,9 +107,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -197,9 +191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -276,9 +267,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -338,9 +326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -404,9 +389,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -455,9 +437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -524,9 +503,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -597,9 +573,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -666,9 +639,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -747,9 +717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -818,9 +785,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -894,9 +858,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -973,9 +934,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1027,9 +985,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1079,9 +1034,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1131,9 +1083,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1185,9 +1134,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1258,9 +1204,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1336,9 +1279,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1415,9 +1355,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1467,9 +1404,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1543,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1620,9 +1551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1705,9 +1633,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1750,9 +1675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1804,9 +1726,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1855,9 +1774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1931,9 +1847,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2007,9 +1920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2083,9 +1993,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2159,9 +2066,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2223,9 +2127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2280,9 +2181,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2346,9 +2244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2400,9 +2295,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2484,9 +2376,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2563,9 +2452,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2709,9 +2595,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2785,9 +2668,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2856,9 +2736,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2938,9 +2815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2990,9 +2864,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3063,9 +2934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3193,9 +3061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3327,9 +3192,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3389,9 +3251,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3881,9 +3740,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3967,9 +3823,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4063,9 +3916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4164,9 +4014,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4240,9 +4087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4322,9 +4166,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4384,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4463,9 +4301,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4527,9 +4362,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4613,9 +4445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4720,9 +4549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4792,9 +4618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4894,9 +4717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4968,9 +4788,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5055,9 +4872,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5164,9 +4978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5278,9 +5089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5387,9 +5195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5501,9 +5306,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5610,9 +5412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5724,9 +5523,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5842,9 +5638,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5965,9 +5758,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6084,9 +5874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6210,9 +5997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6329,9 +6113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6455,9 +6236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6564,9 +6342,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6678,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6812,9 +6584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6932,9 +6701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7051,9 +6817,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7160,9 +6923,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7305,9 +7065,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7379,9 +7136,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7462,9 +7216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7575,9 +7326,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7664,9 +7412,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -7679,8 +7424,7 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/components\/schemas\/document" + "model": "#\/components\/schemas\/documentList" } ] } @@ -7795,9 +7539,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7877,7 +7618,7 @@ "200": { "description": "Documents List", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/documentList" } @@ -7903,9 +7644,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8000,9 +7738,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8099,9 +7834,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8202,9 +7934,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8288,9 +8017,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8373,9 +8099,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8496,9 +8219,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8570,9 +8290,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8653,9 +8370,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8729,9 +8443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8979,9 +8690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9032,9 +8740,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9084,9 +8789,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9146,9 +8848,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9373,9 +9072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9437,9 +9133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9523,9 +9216,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9622,9 +9312,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9694,9 +9381,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9759,9 +9443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9826,9 +9507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9914,9 +9592,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9982,9 +9657,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10059,9 +9731,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10149,9 +9818,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10268,9 +9934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10335,9 +9998,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10409,9 +10069,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10471,9 +10128,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10560,9 +10214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10632,9 +10283,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10721,9 +10369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10797,9 +10442,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10853,9 +10495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10907,9 +10546,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10959,9 +10595,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11011,9 +10644,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11063,9 +10693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11126,9 +10753,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11178,9 +10802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11230,9 +10851,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11282,9 +10900,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11347,9 +10962,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11412,9 +11024,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11488,9 +11097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11553,9 +11159,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11644,9 +11247,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11709,9 +11309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11774,9 +11371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11839,9 +11433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11904,9 +11495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11969,9 +11557,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12034,9 +11619,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12099,9 +11681,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12164,9 +11743,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12216,9 +11792,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12268,9 +11841,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12322,9 +11892,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12378,9 +11945,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12434,9 +11998,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12490,9 +12051,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12546,9 +12104,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12602,9 +12157,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12658,9 +12210,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12714,9 +12263,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12769,9 +12315,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12848,9 +12391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12995,9 +12535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13144,9 +12681,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13302,9 +12836,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13462,9 +12993,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13574,9 +13102,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13689,9 +13214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13745,9 +13267,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13810,9 +13329,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13888,9 +13404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13966,9 +13479,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14045,9 +13555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14153,9 +13660,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14264,9 +13768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14352,9 +13853,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14443,9 +13941,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14561,9 +14056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14682,9 +14174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14780,9 +14269,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14881,9 +14367,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14989,9 +14472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15100,9 +14580,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15246,9 +14723,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15394,9 +14868,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15492,9 +14963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15593,9 +15061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15691,9 +15156,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15792,9 +15254,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15890,9 +15349,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15991,9 +15447,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16089,9 +15542,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16190,9 +15640,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16246,9 +15693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16311,9 +15755,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16389,9 +15830,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16467,9 +15905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16544,9 +15979,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16630,9 +16062,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16693,9 +16122,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16773,9 +16199,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16838,9 +16261,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16916,9 +16336,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17005,9 +16422,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17097,9 +16511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17165,9 +16576,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17241,9 +16649,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17317,9 +16722,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17447,9 +16849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17509,9 +16908,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17636,9 +17032,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17702,9 +17095,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17792,9 +17182,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17894,9 +17281,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17970,9 +17354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18063,9 +17444,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18134,9 +17512,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18205,9 +17580,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18425,9 +17797,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18503,9 +17872,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18583,9 +17949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18672,9 +18035,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18738,9 +18098,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18816,9 +18173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18884,9 +18238,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18974,9 +18325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19089,9 +18437,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19165,9 +18510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19256,9 +18598,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19333,9 +18672,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19434,9 +18770,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19498,9 +18831,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19582,9 +18912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19658,9 +18985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19749,9 +19073,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19837,9 +19158,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19925,9 +19243,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19996,9 +19311,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20060,9 +19372,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20148,9 +19457,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20236,9 +19542,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20354,9 +19657,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20460,9 +19760,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20568,9 +19865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20623,9 +19917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20687,9 +19978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20770,9 +20058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20855,9 +20140,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20941,9 +20223,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21018,9 +20297,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21082,9 +20358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21138,15 +20411,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -21165,9 +20431,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21244,9 +20507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21308,9 +20568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21370,9 +20627,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21432,9 +20686,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21496,9 +20747,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21579,9 +20827,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21662,9 +20907,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21745,9 +20987,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21807,9 +21046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21890,9 +21126,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21952,9 +21185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22007,9 +21237,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22064,9 +21291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22138,9 +21362,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22222,9 +21443,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22298,9 +21516,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22411,9 +21626,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22484,9 +21696,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22576,9 +21785,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22650,9 +21856,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22735,9 +21938,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22818,9 +22018,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index b414baf7a5..d4d33fb9e3 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -102,9 +102,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -155,9 +152,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -248,9 +242,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -330,9 +321,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -394,9 +382,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -459,9 +444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -512,9 +494,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -581,9 +560,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -656,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -724,9 +697,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -805,9 +775,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -875,9 +842,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -954,9 +918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1036,9 +997,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1091,9 +1049,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1144,9 +1099,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1197,9 +1149,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1252,9 +1201,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1327,9 +1273,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1408,9 +1351,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1490,9 +1430,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1543,9 +1480,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1621,9 +1555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1701,9 +1632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1790,9 +1718,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1838,9 +1763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1893,9 +1815,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1946,9 +1865,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2026,9 +1942,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2103,9 +2016,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2241,9 +2151,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2321,9 +2228,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2401,9 +2305,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2464,9 +2365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2522,9 +2420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2587,9 +2482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2641,9 +2533,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2727,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2801,9 +2687,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2865,9 +2748,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2954,9 +2834,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3043,9 +2920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3184,9 +3058,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3264,9 +3135,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3337,9 +3205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3422,9 +3287,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3475,9 +3337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3558,9 +3417,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3687,9 +3543,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3820,9 +3673,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3887,9 +3737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4378,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4465,9 +4309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4560,9 +4401,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4655,9 +4493,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4739,9 +4574,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -4754,10 +4586,10 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/definitions\/document" + "model": "#\/definitions\/documentList" } - ] + ], + "description": "\/docs\/references\/databases\/create-document.md" } ], "auth": { @@ -4868,9 +4700,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4940,7 +4769,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -4971,9 +4802,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5063,9 +4891,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5155,9 +4980,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5254,9 +5076,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5336,9 +5155,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5421,9 +5237,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5542,9 +5355,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5616,9 +5426,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5692,9 +5499,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5768,9 +5572,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5824,9 +5625,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5880,9 +5678,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5936,9 +5731,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5992,9 +5784,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -6048,9 +5837,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -6104,9 +5890,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -6160,9 +5943,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -6217,9 +5997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6304,9 +6081,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6378,9 +6152,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6463,9 +6234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6557,9 +6325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6629,9 +6394,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6720,9 +6482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6794,9 +6553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6868,9 +6624,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7069,9 +6822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7143,9 +6893,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7220,9 +6967,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7314,9 +7058,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7378,9 +7119,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7455,9 +7193,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7521,9 +7256,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7606,9 +7338,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7723,9 +7452,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7795,9 +7521,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7883,9 +7606,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7956,9 +7676,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8054,9 +7771,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8117,9 +7831,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index bc1450a9db..1c1dbd3a9c 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -114,9 +114,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -166,9 +163,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -251,9 +245,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -304,9 +295,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -385,9 +373,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -448,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -512,9 +494,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -565,9 +544,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -633,9 +609,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -707,9 +680,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -774,9 +744,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -854,9 +821,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -923,9 +887,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1002,9 +963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1083,9 +1041,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1137,9 +1092,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1189,9 +1141,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1241,9 +1190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1295,9 +1241,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1369,9 +1312,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1449,9 +1389,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1530,9 +1467,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1582,9 +1516,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1659,9 +1590,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1738,9 +1666,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1826,9 +1751,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1873,9 +1795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1927,9 +1846,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1980,9 +1896,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2060,9 +1973,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2137,9 +2047,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2275,9 +2182,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2355,9 +2259,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2435,9 +2336,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2497,9 +2395,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2554,9 +2449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2618,9 +2510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2671,9 +2560,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2756,9 +2642,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2829,9 +2712,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2892,9 +2772,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2981,9 +2858,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3070,9 +2944,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3211,9 +3082,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3291,9 +3159,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3363,9 +3228,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3447,9 +3309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3499,9 +3358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3581,9 +3437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3710,9 +3563,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3843,9 +3693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3910,9 +3757,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4401,9 +4245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4488,9 +4329,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4583,9 +4421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4676,9 +4511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4748,9 +4580,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4800,9 +4629,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4874,9 +4700,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4960,9 +4783,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5034,9 +4854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5095,9 +4912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5175,9 +4989,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5238,9 +5049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5320,9 +5128,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5429,9 +5234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5498,9 +5300,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5601,9 +5400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5672,9 +5468,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5755,9 +5548,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5863,9 +5653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5973,9 +5760,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6081,9 +5865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6191,9 +5972,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6299,9 +6077,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6409,9 +6184,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6527,9 +6299,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6647,9 +6416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6767,9 +6533,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6891,9 +6654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7011,9 +6771,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7135,9 +6892,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7243,9 +6997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7353,9 +7104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7488,9 +7236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7609,9 +7354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7725,9 +7467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7833,9 +7572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7974,9 +7710,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8045,9 +7778,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8123,9 +7853,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8231,9 +7958,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8315,9 +8039,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -8330,10 +8051,10 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/definitions\/document" + "model": "#\/definitions\/documentList" } - ] + ], + "description": "\/docs\/references\/databases\/create-document.md" } ], "auth": { @@ -8444,9 +8165,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8516,7 +8234,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8547,9 +8267,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8639,9 +8356,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8731,9 +8445,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8830,9 +8541,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8910,9 +8618,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9000,9 +8705,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9081,9 +8783,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9203,9 +8902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9274,9 +8970,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9352,9 +9045,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9434,9 +9124,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9524,9 +9211,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9598,9 +9282,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9680,9 +9361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9754,9 +9432,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10027,9 +9702,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10081,9 +9753,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10134,9 +9803,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10232,9 +9898,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10294,9 +9957,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10368,9 +10028,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10429,9 +10086,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10672,9 +10326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10735,9 +10386,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10817,9 +10465,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10911,9 +10556,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10980,9 +10622,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11044,9 +10683,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11112,9 +10748,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11196,9 +10829,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11268,9 +10898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11342,9 +10969,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11427,9 +11051,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11548,9 +11169,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11613,9 +11231,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11684,9 +11299,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11766,9 +11378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11827,9 +11436,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11915,9 +11521,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11984,9 +11587,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12072,9 +11672,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12145,9 +11742,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12221,9 +11815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12295,9 +11886,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12348,9 +11936,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12401,9 +11986,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12454,9 +12036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12516,9 +12095,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12569,9 +12145,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12622,9 +12195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12675,9 +12245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12739,9 +12306,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12803,9 +12367,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12876,9 +12437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12940,9 +12498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13028,9 +12583,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13092,9 +12644,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13156,9 +12705,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13220,9 +12766,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13284,9 +12827,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13348,9 +12888,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13412,9 +12949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13476,9 +13010,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13540,9 +13071,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13593,9 +13121,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13646,9 +13171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13701,9 +13223,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13757,9 +13276,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13813,9 +13329,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13869,9 +13382,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13925,9 +13435,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13981,9 +13488,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -14037,9 +13541,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -14093,9 +13594,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -14148,9 +13646,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14225,9 +13720,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14385,9 +13877,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14542,9 +14031,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14717,9 +14203,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14889,9 +14372,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15009,9 +14489,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15127,9 +14604,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15184,9 +14658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15248,9 +14719,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15324,9 +14792,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15400,9 +14865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15477,9 +14939,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15594,9 +15053,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15709,9 +15165,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15802,9 +15255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15893,9 +15343,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16022,9 +15469,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16149,9 +15593,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16254,9 +15695,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16357,9 +15795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16474,9 +15909,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16589,9 +16021,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16750,9 +16179,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16908,9 +16334,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17013,9 +16436,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17116,9 +16536,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17221,9 +16638,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17324,9 +16738,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17429,9 +16840,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17532,9 +16940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17637,9 +17042,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17740,9 +17142,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17797,9 +17196,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17861,9 +17257,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17937,9 +17330,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18013,9 +17403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18088,9 +17475,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18180,9 +17564,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18242,9 +17623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18323,9 +17701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18387,9 +17762,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18463,9 +17835,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18548,9 +17917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18638,9 +18004,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18705,9 +18068,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18777,9 +18137,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18852,9 +18209,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18948,9 +18302,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19038,9 +18389,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19120,9 +18468,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19172,9 +18517,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19254,9 +18596,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19306,9 +18645,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19379,9 +18715,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19452,9 +18785,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19575,9 +18905,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19697,9 +19024,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19813,9 +19137,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19928,9 +19249,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19988,9 +19306,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20043,9 +19358,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20105,9 +19417,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20191,9 +19500,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20241,9 +19547,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20320,9 +19623,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20380,9 +19680,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20459,9 +19756,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20521,9 +19815,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20594,9 +19885,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20746,9 +20034,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20806,9 +20091,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20933,9 +20215,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20995,9 +20274,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21089,9 +20365,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21169,9 +20442,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21249,9 +20519,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21329,9 +20596,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21409,9 +20673,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21503,9 +20764,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21586,9 +20844,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21666,9 +20921,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21746,9 +20998,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21826,9 +21075,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21906,9 +21152,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22005,9 +21248,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22094,9 +21334,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22154,9 +21391,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22250,9 +21484,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22318,9 +21549,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22415,9 +21643,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22485,9 +21710,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22626,9 +21848,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22686,9 +21905,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22810,9 +22026,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22878,9 +22091,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22977,9 +22187,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23047,9 +22254,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23149,9 +22353,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23229,9 +22430,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23360,9 +22558,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23500,9 +22695,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23580,9 +22772,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23802,9 +22991,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24036,7 +23222,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -24065,9 +23253,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24289,9 +23474,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24508,9 +23690,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24714,7 +23893,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], @@ -24743,9 +23924,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24964,9 +24142,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25024,9 +24199,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25146,9 +24318,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25214,9 +24383,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25337,9 +24503,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25407,9 +24570,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25477,9 +24637,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25550,9 +24707,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25641,9 +24795,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25696,9 +24847,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25758,9 +24906,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25820,9 +24965,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25894,9 +25036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26035,9 +25174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26096,9 +25232,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26231,9 +25364,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26296,9 +25426,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26381,9 +25508,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26475,9 +25599,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26547,9 +25668,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26638,9 +25756,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26712,9 +25827,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26786,9 +25898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26987,9 +26096,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27059,9 +26165,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27133,9 +26236,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27217,9 +26317,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27294,9 +26391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27388,9 +26482,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27452,9 +26543,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27529,9 +26617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27593,9 +26678,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27669,9 +26751,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27754,9 +26833,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27871,9 +26947,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27943,9 +27016,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28031,9 +27101,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28104,9 +27171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28201,9 +27265,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28263,9 +27324,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28344,9 +27402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28418,9 +27473,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28515,9 +27567,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28608,9 +27657,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28701,9 +27747,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28772,9 +27815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28835,9 +27875,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28928,9 +27965,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29021,9 +28055,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29149,9 +28180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29263,9 +28291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29377,9 +28402,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29451,9 +28473,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29507,9 +28526,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29570,9 +28586,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29651,9 +28664,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29735,9 +28745,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29819,9 +28826,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29894,9 +28898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29957,9 +28958,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30013,11 +29011,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -30036,9 +29031,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30112,9 +29104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30175,9 +29164,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30236,9 +29222,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30297,9 +29280,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30360,9 +29340,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30441,9 +29418,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30522,9 +29496,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30603,9 +29574,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30664,9 +29632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30745,9 +29710,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30806,9 +29768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30862,9 +29821,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30920,9 +29876,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30991,9 +29944,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31073,9 +30023,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31147,9 +30094,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31262,9 +30206,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31332,9 +30273,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31424,9 +30362,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31495,9 +30430,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31579,9 +30511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31660,9 +30589,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31741,9 +30667,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31810,9 +30733,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31897,9 +30817,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31967,9 +30884,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32037,9 +30951,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32116,9 +31027,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32198,9 +31106,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32286,9 +31191,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32361,9 +31263,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32416,9 +31315,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 29030aef75..5b069cb633 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -117,9 +117,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -171,9 +168,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -264,9 +258,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -347,9 +338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -412,9 +400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -478,9 +463,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -531,9 +513,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -601,9 +580,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -677,9 +653,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -746,9 +719,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -828,9 +798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -899,9 +866,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -978,9 +942,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1061,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1117,9 +1075,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1171,9 +1126,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1225,9 +1177,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1281,9 +1230,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1357,9 +1303,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1439,9 +1382,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1522,9 +1462,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1576,9 +1513,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1655,9 +1589,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1736,9 +1667,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1826,9 +1754,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1875,9 +1800,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1931,9 +1853,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1984,9 +1903,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2064,9 +1980,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2144,9 +2057,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2224,9 +2134,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2304,9 +2211,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2368,9 +2272,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2427,9 +2328,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2493,9 +2391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2549,9 +2444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2638,9 +2530,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2727,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2868,9 +2754,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2948,9 +2831,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3022,9 +2902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3108,9 +2985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3162,9 +3036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3246,9 +3117,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3377,9 +3245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3512,9 +3377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3581,9 +3443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4074,9 +3933,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4163,9 +4019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4260,9 +4113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4355,9 +4205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4430,9 +4277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4517,9 +4361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4579,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4660,9 +4498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4724,9 +4559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4807,9 +4639,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4917,9 +4746,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4987,9 +4813,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5091,9 +4914,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5163,9 +4983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5247,9 +5064,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5356,9 +5170,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5467,9 +5278,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5576,9 +5384,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5687,9 +5492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5796,9 +5598,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5907,9 +5706,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6026,9 +5822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6147,9 +5940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6268,9 +6058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6393,9 +6180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6514,9 +6298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6639,9 +6420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6748,9 +6526,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6859,9 +6634,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6995,9 +6767,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7117,9 +6886,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7234,9 +7000,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7343,9 +7106,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7485,9 +7245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7557,9 +7314,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7636,9 +7390,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7745,9 +7496,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7831,9 +7579,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "additional-methods": [ { "name": "createDocuments", @@ -7846,10 +7591,10 @@ "responses": [ { "code": 201, - "description": "", - "model": "#\/definitions\/document" + "model": "#\/definitions\/documentList" } - ] + ], + "description": "\/docs\/references\/databases\/create-document.md" } ], "auth": { @@ -7962,9 +7707,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8036,7 +7778,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8067,9 +7811,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8161,9 +7902,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8255,9 +7993,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8356,9 +8091,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8438,9 +8170,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8520,9 +8249,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8643,9 +8369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8715,9 +8438,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8794,9 +8514,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8869,9 +8586,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9143,9 +8857,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9198,9 +8909,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9252,9 +8960,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9314,9 +9019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9558,9 +9260,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9622,9 +9321,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9705,9 +9401,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9800,9 +9493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9870,9 +9560,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9935,9 +9622,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10004,9 +9688,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10089,9 +9770,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10162,9 +9840,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10237,9 +9912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10324,9 +9996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10447,9 +10116,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10514,9 +10180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10586,9 +10249,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10648,9 +10308,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10737,9 +10394,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10807,9 +10461,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10896,9 +10547,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10970,9 +10618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11048,9 +10693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11124,9 +10766,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11178,9 +10817,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11232,9 +10868,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11286,9 +10919,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11349,9 +10979,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11403,9 +11030,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11457,9 +11081,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11511,9 +11132,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11576,9 +11194,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11641,9 +11256,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11715,9 +11327,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11780,9 +11389,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11869,9 +11475,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11934,9 +11537,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11999,9 +11599,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12064,9 +11661,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12129,9 +11723,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12194,9 +11785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12259,9 +11847,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12324,9 +11909,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12389,9 +11971,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12443,9 +12022,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12497,9 +12073,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12553,9 +12126,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12611,9 +12181,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12669,9 +12236,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12727,9 +12291,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12785,9 +12346,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12843,9 +12401,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12901,9 +12456,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12959,9 +12511,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -13016,9 +12565,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13094,9 +12640,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13255,9 +12798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13413,9 +12953,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13589,9 +13126,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13762,9 +13296,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13883,9 +13414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14002,9 +13530,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14060,9 +13585,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14125,9 +13647,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14202,9 +13721,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14279,9 +13795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14357,9 +13870,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14475,9 +13985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14591,9 +14098,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14685,9 +14189,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14777,9 +14278,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14907,9 +14405,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15035,9 +14530,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15141,9 +14633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15245,9 +14734,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15363,9 +14849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15479,9 +14962,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15641,9 +15121,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15800,9 +15277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15906,9 +15380,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16010,9 +15481,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16116,9 +15584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16220,9 +15685,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16326,9 +15788,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16430,9 +15889,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16536,9 +15992,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16640,9 +16093,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16698,9 +16148,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16763,9 +16210,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16840,9 +16284,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16917,9 +16358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16993,9 +16431,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17086,9 +16521,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17149,9 +16581,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17231,9 +16660,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17296,9 +16722,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17373,9 +16796,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17459,9 +16879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17551,9 +16968,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17619,9 +17033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17693,9 +17104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17768,9 +17176,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17910,9 +17315,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17972,9 +17374,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -18108,9 +17507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -18174,9 +17570,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18261,9 +17654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18357,9 +17747,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18431,9 +17818,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18524,9 +17908,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18600,9 +17981,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18676,9 +18054,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18879,9 +18254,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18955,9 +18327,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19034,9 +18403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19130,9 +18496,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19196,9 +18559,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19275,9 +18635,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19343,9 +18700,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19430,9 +18784,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19549,9 +18900,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19623,9 +18971,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19713,9 +19058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19788,9 +19130,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19887,9 +19226,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19951,9 +19287,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -20034,9 +19367,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20109,9 +19439,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20207,9 +19534,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20301,9 +19625,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20395,9 +19716,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20467,9 +19785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20531,9 +19846,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20625,9 +19937,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20719,9 +20028,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20848,9 +20154,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20963,9 +20266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21078,9 +20378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21135,9 +20432,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21199,9 +20493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21281,9 +20572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21366,9 +20654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21451,9 +20736,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21527,9 +20809,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21591,9 +20870,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21648,11 +20924,8 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -21671,9 +20944,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21748,9 +21018,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21812,9 +21079,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21874,9 +21138,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21936,9 +21197,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22000,9 +21258,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22082,9 +21337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22164,9 +21416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22246,9 +21495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22308,9 +21554,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22390,9 +21633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22452,9 +21692,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22509,9 +21746,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22568,9 +21802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22640,9 +21871,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22723,9 +21951,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22798,9 +22023,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22914,9 +22136,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22985,9 +22204,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23078,9 +22294,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23150,9 +22363,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23235,9 +22445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23317,9 +22524,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 8e29b02518..6fc6d66ff6 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -25,7 +25,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; use Appwrite\Utopia\Database\Validator\CustomId; @@ -295,7 +295,7 @@ App::post('/v1/account') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -438,7 +438,7 @@ App::get('/v1/account') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -467,7 +467,7 @@ App::delete('/v1/account') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->inject('user') ->inject('project') @@ -519,7 +519,7 @@ App::get('/v1/account/sessions') model: Response::MODEL_SESSION_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->inject('response') ->inject('user') @@ -568,7 +568,7 @@ App::delete('/v1/account/sessions') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->label('abuse-limit', 100) ->inject('request') @@ -637,7 +637,7 @@ App::get('/v1/account/sessions/:sessionId') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.') ->inject('response') @@ -690,7 +690,7 @@ App::delete('/v1/account/sessions/:sessionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->label('abuse-limit', 100) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.') @@ -778,7 +778,7 @@ App::patch('/v1/account/sessions/:sessionId') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to update the current device session.') @@ -862,7 +862,7 @@ App::post('/v1/account/sessions/email') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') @@ -1002,7 +1002,7 @@ App::post('/v1/account/sessions/anonymous') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') @@ -1145,7 +1145,7 @@ App::post('/v1/account/sessions/token') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') @@ -1171,7 +1171,7 @@ App::get('/v1/account/sessions/oauth2/:provider') namespace: 'account', name: 'createOAuth2Session', description: '/docs/references/account/create-session-oauth2.md', - methodType: MethodType::WEBAUTH, + type: MethodType::WEBAUTH, auth: [], responses: [ new SDKResponse( @@ -1179,7 +1179,7 @@ App::get('/v1/account/sessions/oauth2/:provider') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::HTML, + contentType: ContentType::HTML, hide: [APP_PLATFORM_SERVER], )) ->label('abuse-limit', 50) @@ -1775,8 +1775,8 @@ App::get('/v1/account/tokens/oauth2/:provider') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::HTML, - methodType: MethodType::WEBAUTH, + contentType: ContentType::HTML, + type: MethodType::WEBAUTH, )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') @@ -1855,7 +1855,7 @@ App::post('/v1/account/tokens/magic-url') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -2105,7 +2105,7 @@ App::post('/v1/account/tokens/email') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') @@ -2340,7 +2340,7 @@ App::put('/v1/account/sessions/magic-url') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, deprecated: true, )) ->label('abuse-limit', 10) @@ -2377,7 +2377,7 @@ App::put('/v1/account/sessions/phone') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, deprecated: true, )) ->label('abuse-limit', 10) @@ -2415,7 +2415,7 @@ App::post('/v1/account/tokens/phone') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) @@ -2599,7 +2599,7 @@ App::post('/v1/account/jwts') model: Response::MODEL_JWT, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 100) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -2647,7 +2647,7 @@ App::get('/v1/account/prefs') model: Response::MODEL_PREFERENCES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -2673,7 +2673,7 @@ App::get('/v1/account/logs') model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2747,7 +2747,7 @@ App::patch('/v1/account/name') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') ->inject('requestTimestamp') @@ -2785,7 +2785,7 @@ App::patch('/v1/account/password') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) @@ -2858,7 +2858,7 @@ App::patch('/v1/account/email') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -2954,7 +2954,7 @@ App::patch('/v1/account/phone') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') @@ -3039,7 +3039,7 @@ App::patch('/v1/account/prefs') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') ->inject('requestTimestamp') @@ -3076,7 +3076,7 @@ App::patch('/v1/account/status') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->inject('requestTimestamp') ->inject('request') @@ -3126,7 +3126,7 @@ App::post('/v1/account/recovery') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) @@ -3312,7 +3312,7 @@ App::put('/v1/account/recovery') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3402,7 +3402,7 @@ App::post('/v1/account/verification') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -3573,7 +3573,7 @@ App::put('/v1/account/verification') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') @@ -3639,7 +3639,7 @@ App::post('/v1/account/verification/phone') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},userId:{userId}', 'url:{url},ip:{ip}']) @@ -3772,7 +3772,7 @@ App::put('/v1/account/verification/phone') model: Response::MODEL_TOKEN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'userId:{param-userId}') @@ -3837,7 +3837,7 @@ App::patch('/v1/account/mfa') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('requestTimestamp') @@ -3890,7 +3890,7 @@ App::get('/v1/account/mfa/factors') model: Response::MODEL_MFA_FACTORS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -3930,7 +3930,7 @@ App::post('/v1/account/mfa/authenticators/:type') model: Response::MODEL_MFA_TYPE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') @@ -4006,7 +4006,7 @@ App::put('/v1/account/mfa/authenticators/:type') model: Response::MODEL_USER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') @@ -4075,7 +4075,7 @@ App::post('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -4121,7 +4121,7 @@ App::patch('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('dbForProject') ->inject('response') @@ -4162,7 +4162,7 @@ App::get('/v1/account/mfa/recovery-codes') model: Response::MODEL_MFA_RECOVERY_CODES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('user') @@ -4200,7 +4200,7 @@ App::delete('/v1/account/mfa/authenticators/:type') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -4245,7 +4245,7 @@ App::post('/v1/account/mfa/challenge') model: Response::MODEL_MFA_CHALLENGE, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') @@ -4439,7 +4439,7 @@ App::put('/v1/account/mfa/challenge') model: Response::MODEL_SESSION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') @@ -4532,7 +4532,7 @@ App::post('/v1/account/targets/push') model: Response::MODEL_TARGET, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4612,7 +4612,7 @@ App::put('/v1/account/targets/:targetId/push') model: Response::MODEL_TARGET, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') @@ -4676,7 +4676,7 @@ App::delete('/v1/account/targets/:targetId/push') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -4726,7 +4726,7 @@ App::get('/v1/account/identities') model: Response::MODEL_IDENTITY_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -4797,7 +4797,7 @@ App::delete('/v1/account/identities/:identityId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index e06b8c9ff1..d8a50e15b4 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -5,7 +5,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; @@ -174,14 +174,14 @@ App::get('/v1/avatars/credit-cards/:code') name: 'getCreditCard', description: '/docs/references/avatars/get-credit-card.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -201,14 +201,14 @@ App::get('/v1/avatars/browsers/:code') name: 'getBrowser', description: '/docs/references/avatars/get-browser.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -228,14 +228,14 @@ App::get('/v1/avatars/flags/:code') name: 'getFlag', description: '/docs/references/avatars/get-flag.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -255,14 +255,14 @@ App::get('/v1/avatars/image') name: 'getImage', description: '/docs/references/avatars/get-image.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE + contentType: ContentType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) @@ -325,14 +325,14 @@ App::get('/v1/avatars/favicon') name: 'getFavicon', description: '/docs/references/avatars/get-favicon.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE + contentType: ContentType::IMAGE )) ->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.') ->inject('response') @@ -475,14 +475,14 @@ App::get('/v1/avatars/qr') name: 'getQR', description: '/docs/references/avatars/get-qr.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) @@ -523,14 +523,14 @@ App::get('/v1/avatars/initials') name: 'getInitials', description: '/docs/references/avatars/get-initials.md', auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], - methodType: MethodType::LOCATION, + type: MethodType::LOCATION, responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, model: Response::MODEL_NONE, ) ], - responseType: ResponseType::IMAGE_PNG + contentType: ContentType::IMAGE_PNG )) ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 1d5cc085d6..da4ecf8551 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -4,7 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Document; @@ -36,7 +36,7 @@ App::get('/v1/console/variables') model: Response::MODEL_CONSOLE_VARIABLES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -81,7 +81,7 @@ App::post('/v1/console/assistant') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::TEXT + contentType: ContentType::TEXT )) ->label('abuse-limit', 15) ->label('abuse-key', 'userId:{userId}') diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 825b4601e9..b56401ffd5 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -10,7 +10,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; use Appwrite\Utopia\Database\Validator\Queries\Collections; @@ -463,7 +463,7 @@ App::post('/v1/databases') model: Response::MODEL_DATABASE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') @@ -545,7 +545,7 @@ App::get('/v1/databases') model: Response::MODEL_DATABASE_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -607,7 +607,7 @@ App::get('/v1/databases/:databaseId') model: Response::MODEL_DATABASE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -639,7 +639,7 @@ App::get('/v1/databases/:databaseId/logs') model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -740,7 +740,7 @@ App::put('/v1/databases/:databaseId') model: Response::MODEL_DATABASE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') @@ -785,7 +785,7 @@ App::delete('/v1/databases/:databaseId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') @@ -841,7 +841,7 @@ App::post('/v1/databases/:databaseId/collections') model: Response::MODEL_COLLECTION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -912,7 +912,7 @@ App::get('/v1/databases/:databaseId/collections') model: Response::MODEL_COLLECTION_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) @@ -984,7 +984,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_COLLECTION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1025,7 +1025,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1130,7 +1130,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_COLLECTION, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -1204,7 +1204,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -2076,7 +2076,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin model: Response::MODEL_ATTRIBUTE_STRING, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2127,7 +2127,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email model: Response::MODEL_ATTRIBUTE_EMAIL, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2176,7 +2176,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/ model: Response::MODEL_ATTRIBUTE_ENUM, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2227,7 +2227,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k model: Response::MODEL_ATTRIBUTE_IP, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2276,7 +2276,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/: model: Response::MODEL_ATTRIBUTE_URL, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2325,7 +2325,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ model: Response::MODEL_ATTRIBUTE_INTEGER, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2384,7 +2384,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float model: Response::MODEL_ATTRIBUTE_FLOAT, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2443,7 +2443,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole model: Response::MODEL_ATTRIBUTE_BOOLEAN, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2491,7 +2491,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet model: Response::MODEL_ATTRIBUTE_DATETIME, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2539,7 +2539,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2604,7 +2604,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2725,7 +2725,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') model: Response::MODEL_INDEX, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2899,7 +2899,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') model: Response::MODEL_INDEX_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -2981,7 +2981,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') model: Response::MODEL_INDEX, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3030,7 +3030,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3107,7 +3107,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, parameters: [ 'documentId' => ['optional' => false], 'data' => ['optional' => false], @@ -3125,7 +3125,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, parameters: [ 'documents' => ['optional' => false], ] @@ -3425,7 +3425,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3585,7 +3585,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -3682,7 +3682,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen model: Response::MODEL_LOG_LIST, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -3799,7 +3799,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum model: Response::MODEL_DOCUMENT, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4040,7 +4040,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') @@ -4182,7 +4182,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4305,7 +4305,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') model: Response::MODEL_DOCUMENT_LIST, ) ], - responseType: ResponseType::NONE + contentType: ContentType::JSON )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -4413,7 +4413,7 @@ App::get('/v1/databases/usage') model: Response::MODEL_USAGE_DATABASES, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') @@ -4502,7 +4502,7 @@ App::get('/v1/databases/:databaseId/usage') model: Response::MODEL_USAGE_DATABASE, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) @@ -4597,7 +4597,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') model: Response::MODEL_USAGE_COLLECTION, ) ], - responseType: ResponseType::JSON, + contentType: ContentType::JSON, )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 8c125e5c13..b732a0dcfb 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -18,7 +18,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; @@ -1025,8 +1025,8 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::ANY, - methodType: MethodType::LOCATION + contentType: ContentType::ANY, + type: MethodType::LOCATION )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1189,7 +1189,7 @@ App::delete('/v1/functions/:functionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') @@ -1245,7 +1245,7 @@ App::post('/v1/functions/:functionId/deployments') ) ], requestType: 'multipart/form-data', - methodType: MethodType::UPLOAD, + type: MethodType::UPLOAD, packaging: true, )) ->param('functionId', '', new UID(), 'Function ID.') @@ -1607,7 +1607,7 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') @@ -1850,7 +1850,7 @@ App::post('/v1/functions/:functionId/executions') model: Response::MODEL_EXECUTION, ) ], - responseType: ResponseType::MULTIPART, + contentType: ContentType::MULTIPART, requestType: 'application/json', )) ->param('functionId', '', new UID(), 'Function ID.') @@ -2407,7 +2407,7 @@ App::delete('/v1/functions/:functionId/executions/:executionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') @@ -2704,7 +2704,7 @@ App::delete('/v1/functions/:functionId/variables/:variableId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 62a7c72d61..72951b608e 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -99,7 +99,7 @@ App::post('/v1/graphql/mutation') model: Response::MODEL_ANY, ) ], - methodType: MethodType::GRAPHQL, + type: MethodType::GRAPHQL, additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], @@ -149,7 +149,7 @@ App::post('/v1/graphql') model: Response::MODEL_ANY, ) ], - methodType: MethodType::GRAPHQL, + type: MethodType::GRAPHQL, additionalParameters: [ 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], ], diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index baa737ce1e..226349f614 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -6,7 +6,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; @@ -41,7 +41,7 @@ App::get('/v1/health') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -79,7 +79,7 @@ App::get('/v1/health/db') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -139,7 +139,7 @@ App::get('/v1/health/cache') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -203,7 +203,7 @@ App::get('/v1/health/queue') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -266,7 +266,7 @@ App::get('/v1/health/pubsub') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('pools') @@ -330,7 +330,7 @@ App::get('/v1/health/time') model: Response::MODEL_HEALTH_TIME, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -393,7 +393,7 @@ App::get('/v1/health/queue/webhooks') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -426,7 +426,7 @@ App::get('/v1/health/queue/logs') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -459,7 +459,7 @@ App::get('/v1/health/certificate') model: Response::MODEL_HEALTH_CERTIFICATE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') ->inject('response') @@ -515,7 +515,7 @@ App::get('/v1/health/queue/certificates') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -548,7 +548,7 @@ App::get('/v1/health/queue/builds') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -581,7 +581,7 @@ App::get('/v1/health/queue/databases') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) @@ -615,7 +615,7 @@ App::get('/v1/health/queue/deletes') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -648,7 +648,7 @@ App::get('/v1/health/queue/mails') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -681,7 +681,7 @@ App::get('/v1/health/queue/messaging') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -714,7 +714,7 @@ App::get('/v1/health/queue/migrations') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -747,7 +747,7 @@ App::get('/v1/health/queue/functions') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -780,7 +780,7 @@ App::get('/v1/health/queue/usage') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -813,7 +813,7 @@ App::get('/v1/health/queue/usage-dump') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -846,7 +846,7 @@ App::get('/v1/health/storage/local') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -895,7 +895,7 @@ App::get('/v1/health/storage') model: Response::MODEL_HEALTH_STATUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->inject('deviceForFiles') @@ -942,7 +942,7 @@ App::get('/v1/health/anti-virus') model: Response::MODEL_HEALTH_ANTIVIRUS, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->inject('response') ->action(function (Response $response) { @@ -987,7 +987,7 @@ App::get('/v1/health/queue/failed/:name') model: Response::MODEL_HEALTH_QUEUE, ) ], - responseType: ResponseType::JSON + contentType: ContentType::JSON )) ->param('name', '', new WhiteList([ Event::DATABASE_QUEUE_NAME, diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 7a1bbc5994..45ab4c18e5 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -14,7 +14,7 @@ use Appwrite\Role; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -2052,7 +2052,7 @@ App::delete('/v1/messaging/providers/:providerId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') @@ -2381,7 +2381,7 @@ App::delete('/v1/messaging/topics/:topicId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') @@ -2755,7 +2755,7 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') @@ -4157,7 +4157,7 @@ App::delete('/v1/messaging/messages/:messageId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 71156df789..fe0f48b3e9 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -10,7 +10,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -709,7 +709,7 @@ App::get('/v1/migrations/firebase/connect') ) ], hide: true, - methodType: MethodType::WEBAUTH + type: MethodType::WEBAUTH )) ->param('redirect', '', fn ($clients) => new Host($clients), 'URL to redirect back to your Firebase authorization. Only console hostnames are allowed.', true, ['clients']) ->param('projectId', '', new UID(), 'Project ID') @@ -1145,7 +1145,7 @@ App::delete('/v1/migrations/:migrationId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 0ad69ab1ec..d50f5f1d46 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -4,7 +4,7 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; @@ -503,7 +503,7 @@ App::delete('/v1/project/variables/:variableId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 451e732306..4df8566bc0 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -13,7 +13,7 @@ use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; @@ -1085,7 +1085,7 @@ App::delete('/v1/projects/:projectId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') @@ -1380,7 +1380,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') @@ -1613,7 +1613,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') @@ -1890,7 +1890,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') @@ -2306,7 +2306,7 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') model: Response::MODEL_SMS_TEMPLATE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') @@ -2356,7 +2356,7 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') model: Response::MODEL_EMAIL_TEMPLATE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index e3917acc02..b824f0f1fc 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -8,7 +8,7 @@ use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -281,7 +281,7 @@ App::delete('/v1/proxy/rules/:ruleId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index b2a3f23dfb..1b0d72100c 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -12,7 +12,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; @@ -340,7 +340,7 @@ App::delete('/v1/storage/buckets/:bucketId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') @@ -386,7 +386,7 @@ App::post('/v1/storage/buckets/:bucketId/files') namespace: 'storage', name: 'createFile', description: '/docs/references/storage/create-file.md', - methodType: MethodType::UPLOAD, + type: MethodType::UPLOAD, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], requestType: 'multipart/form-data', responses: [ @@ -915,8 +915,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') model: Response::MODEL_NONE ) ], - methodType: MethodType::LOCATION, - responseType: ResponseType::IMAGE + type: MethodType::LOCATION, + contentType: ContentType::IMAGE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID') @@ -1092,8 +1092,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') model: Response::MODEL_NONE ) ], - methodType: MethodType::LOCATION, - responseType: ResponseType::ANY, + type: MethodType::LOCATION, + contentType: ContentType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1240,8 +1240,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') model: Response::MODEL_NONE, ) ], - methodType: MethodType::LOCATION, - responseType: ResponseType::ANY, + type: MethodType::LOCATION, + contentType: ContentType::ANY, )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') @@ -1674,7 +1674,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 2cc88e11a7..b3f5e75979 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -14,7 +14,7 @@ use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; @@ -377,7 +377,7 @@ App::delete('/v1/teams/:teamId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') @@ -1214,7 +1214,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 64b7f5dbc8..4694cbc5d5 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -18,7 +18,7 @@ use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -1903,11 +1903,11 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') auth: [AuthType::KEY], responses: [ new SDKResponse( - code: Response::STATUS_CODE_OK, - model: Response::MODEL_USER, + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') @@ -2090,7 +2090,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') @@ -2140,7 +2140,7 @@ App::delete('/v1/users/:userId/sessions') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2189,7 +2189,7 @@ App::delete('/v1/users/:userId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') @@ -2238,7 +2238,7 @@ App::delete('/v1/users/:userId/targets/:targetId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') @@ -2295,7 +2295,7 @@ App::delete('/v1/users/identities/:identityId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE, + contentType: ContentType::NONE, )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 2c4424a348..b2272bad42 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -8,7 +8,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -285,8 +285,8 @@ App::get('/v1/vcs/github/authorize') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::HTML, - methodType: MethodType::WEBAUTH, + contentType: ContentType::HTML, + type: MethodType::WEBAUTH, hide: true, )) ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients']) @@ -1192,7 +1192,7 @@ App::delete('/v1/vcs/installations/:installationId') model: Response::MODEL_NONE, ) ], - responseType: ResponseType::NONE + contentType: ContentType::NONE )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') diff --git a/app/controllers/general.php b/app/controllers/general.php index 4cee363317..515b89dc5e 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -13,7 +13,7 @@ use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ResponseType; +use Appwrite\SDK\ContentType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; @@ -111,7 +111,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo model: Response::MODEL_EXECUTION, ) ], - responseType: ResponseType::MULTIPART, + contentType: ContentType::MULTIPART, requestType: 'application/json', )); } else { diff --git a/src/Appwrite/SDK/ResponseType.php b/src/Appwrite/SDK/ContentType.php similarity index 91% rename from src/Appwrite/SDK/ResponseType.php rename to src/Appwrite/SDK/ContentType.php index 8d34fb1a90..174c889815 100644 --- a/src/Appwrite/SDK/ResponseType.php +++ b/src/Appwrite/SDK/ContentType.php @@ -2,7 +2,7 @@ namespace Appwrite\SDK; -enum ResponseType: string +enum ContentType: string { case NONE = ''; case JSON = 'application/json'; diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index c1c4a3e6e2..f6859209cb 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -20,7 +20,7 @@ class Method * @param string $description * @param array $auth * @param array $responses - * @param ResponseType $responseType + * @param ContentType $responseType * @param MethodType|null $methodType * @param bool $deprecated * @param array|bool $hide @@ -37,8 +37,8 @@ class Method protected string $description, protected array $auth, protected array $responses, - protected ResponseType $responseType = ResponseType::JSON, - protected ?MethodType $methodType = null, + protected ContentType $contentType = ContentType::JSON, + protected ?MethodType $type = null, protected bool $deprecated = false, protected array|bool $hide = false, protected bool $packaging = false, @@ -157,14 +157,14 @@ class Method return $this->responses; } - public function getResponseType(): ResponseType + public function getContentType(): ContentType { - return $this->responseType; + return $this->contentType; } - public function getMethodType(): ?MethodType + public function getType(): ?MethodType { - return $this->methodType; + return $this->type; } public function isDeprecated(): bool @@ -235,15 +235,15 @@ class Method return $this; } - public function setResponseType(ResponseType $responseType): self + public function setContentType(ContentType $contentType): self { - $this->responseType = $responseType; + $this->contentType = $contentType; return $this; } - public function setMethodType(?MethodType $methodType): self + public function setType(?MethodType $type): self { - $this->methodType = $methodType; + $this->type = $type; return $this; } diff --git a/src/Appwrite/SDK/Response.php b/src/Appwrite/SDK/Response.php index 9cd72951dc..e87813024b 100644 --- a/src/Appwrite/SDK/Response.php +++ b/src/Appwrite/SDK/Response.php @@ -11,8 +11,7 @@ class Response */ public function __construct( private int $code, - private string|array $model, - private string $description = '', + private string|array $model ) { } @@ -25,9 +24,4 @@ class Response { return $this->model; } - - public function getDescription(): string - { - return $this->description; - } } diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 3c8df24e48..02568a8ccf 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -149,7 +149,7 @@ class OpenAPI3 extends Format } $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; - $produces = ($sdk->getResponseType())->value; + $produces = ($sdk->getContentType())->value; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -187,7 +187,7 @@ class OpenAPI3 extends Format 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $sdk->getMethodType()->value ?? '', + 'type' => $sdk->getType()->value ?? '', 'deprecated' => $sdk->isDeprecated(), 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', @@ -224,7 +224,6 @@ class OpenAPI3 extends Format /** @var \Appwrite\SDK\Response $response */ $additionalMethod['responses'][] = [ 'code' => $response->getCode(), - 'description' => $response->getDescription(), 'model' => '#/components/schemas/' . $response->getModel() ]; } @@ -360,7 +359,7 @@ class OpenAPI3 extends Format $node['schema']['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($sdk->getMethodType() === MethodType::UPLOAD) { + if ($sdk->getType() === MethodType::UPLOAD) { $node['schema']['x-upload-id'] = true; } $node['schema']['type'] = $validator->getType(); diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index d07d64d66a..22aac47113 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -145,7 +145,7 @@ class Swagger2 extends Format } $desc = (!empty($sdk->getDescription())) ? \realpath(__DIR__ . '/../../../../' . $sdk->getDescription()) : null; - $produces = ($sdk->getResponseType())->value; + $produces = ($sdk->getContentType())->value; $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; @@ -185,7 +185,7 @@ class Swagger2 extends Format 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $sdk->getMethodType()->value ?? '', + 'type' => $sdk->getType()->value ?? '', 'deprecated' => $sdk->isDeprecated(), 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', @@ -210,7 +210,8 @@ class Swagger2 extends Format 'name' => $method->getMethodName(), 'parameters' => [], 'required' => [], - 'responses' => [] + 'responses' => [], + 'description' => $method->getDescription(), ]; foreach ($method->getParameters() as $name => $param) { @@ -225,7 +226,6 @@ class Swagger2 extends Format /** @var \Appwrite\SDK\Response $response */ $additionalMethod['responses'][] = [ 'code' => $response->getCode(), - 'description' => $response->getDescription(), 'model' => '#/definitions/' . $response->getModel() ]; } @@ -377,7 +377,7 @@ class Swagger2 extends Format $node['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($sdk->getMethodType() === MethodType::UPLOAD) { + if ($sdk->getType() === MethodType::UPLOAD) { $node['x-upload-id'] = true; } $node['type'] = $validator->getType(); From 1691910023183587a0eeceb5c0d1aafa4f910c00 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 12:56:46 +0900 Subject: [PATCH 24/29] Run Linter --- app/controllers/api/account.php | 2 +- app/controllers/api/avatars.php | 2 +- app/controllers/api/console.php | 2 +- app/controllers/api/databases.php | 2 +- app/controllers/api/functions.php | 2 +- app/controllers/api/health.php | 2 +- app/controllers/api/messaging.php | 2 +- app/controllers/api/migrations.php | 2 +- app/controllers/api/project.php | 2 +- app/controllers/api/projects.php | 2 +- app/controllers/api/proxy.php | 2 +- app/controllers/api/storage.php | 2 +- app/controllers/api/teams.php | 2 +- app/controllers/api/users.php | 2 +- app/controllers/api/vcs.php | 2 +- app/controllers/general.php | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 6fc6d66ff6..de73fb91b6 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -22,10 +22,10 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; use Appwrite\Utopia\Database\Validator\CustomId; diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index d8a50e15b4..19ac4a6538 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -2,10 +2,10 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index da4ecf8551..dc93946714 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -2,9 +2,9 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Document; diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index b56401ffd5..093ba7898b 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -8,9 +8,9 @@ use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; use Appwrite\Utopia\Database\Validator\Queries\Collections; diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index b732a0dcfb..71312330fc 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -15,10 +15,10 @@ use Appwrite\Functions\Validator\RuntimeSpecification; use Appwrite\Messaging\Adapter\Realtime; use Appwrite\Platform\Tasks\ScheduleExecutions; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 226349f614..1db4713311 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -4,9 +4,9 @@ use Appwrite\ClamAV\Network; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 45ab4c18e5..65ea6a9e32 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -12,9 +12,9 @@ use Appwrite\Network\Validator\Email; use Appwrite\Permission; use Appwrite\Role; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index fe0f48b3e9..cbf6513daa 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -7,10 +7,10 @@ use Appwrite\Extend\Exception; use Appwrite\Permission; use Appwrite\Role; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index d50f5f1d46..61ceb8fff2 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -2,9 +2,9 @@ use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 4df8566bc0..e6df57a9cd 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -11,9 +11,9 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index b824f0f1fc..8f76443800 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -6,9 +6,9 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\CNAME; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 1b0d72100c..3801b9007d 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -9,10 +9,10 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index b3f5e75979..8cc26555c9 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -12,9 +12,9 @@ use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 4694cbc5d5..92c6e1cd47 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -16,9 +16,9 @@ use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index b2272bad42..a471a7d76d 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -5,10 +5,10 @@ use Appwrite\Event\Build; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; diff --git a/app/controllers/general.php b/app/controllers/general.php index 515b89dc5e..5457f310b3 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -11,9 +11,9 @@ use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\SDK\ContentType; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; From 48bf8001aeef1605c3adf2e74e16617a5768b748 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 15 Jan 2025 16:17:35 +0900 Subject: [PATCH 25/29] Address Comments --- src/Appwrite/SDK/Method.php | 34 +++++++++++++-------------------- src/Appwrite/Utopia/Request.php | 26 +++++++++++++++++++------ 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index f6859209cb..8064b75561 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -8,7 +8,7 @@ use Swoole\Http\Response as HttpResponse; class Method { - public static array $knownMethods = []; + public static array $processed = []; public static array $errors = []; @@ -53,8 +53,6 @@ class Method foreach ($responses as $response) { /** @var SDKResponse $response */ $this->validateResponseModel($response->getModel()); - - // No content check $this->validateNoContent($response); } } @@ -66,11 +64,11 @@ class Method private function validateMethod(string $name, string $namespace): void { - if (\in_array($this->getRouteName(), self::$knownMethods)) { + if (\in_array($this->getRouteName(), self::$processed)) { self::$errors[] = "Error with {$this->getRouteName()} method: Method already exists in namespace {$namespace}"; } - self::$knownMethods[] = $this->getRouteName(); + self::$processed[] = $this->getRouteName(); } private function validateAuthTypes(array $authTypes): void @@ -101,22 +99,16 @@ class Method { $response = new Response(new HttpResponse()); - if (\is_array($responseModel)) { - foreach ($responseModel as $model) { - try { - $response->getModel($model); - } catch (\Exception $e) { - self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; - } - } - - return; + if (!\is_array($responseModel)) { + $responseModel = [$responseModel]; } - try { - $response->getModel($responseModel); - } catch (\Exception $e) { - self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; + foreach ($responseModel as $model) { + try { + $response->getModel($model); + } catch (\Exception $e) { + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; + } } } @@ -150,7 +142,7 @@ class Method } /** - * @return Array + * @return array */ public function getResponses(): array { @@ -223,7 +215,7 @@ class Method } /** - * @param Array $responses + * @param array $responses */ public function setResponses(array $responses): self { diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index a4fc0e0f63..086d694378 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -28,15 +28,29 @@ class Request extends UtopiaRequest $parameters = parent::getParams(); if ($this->hasFilters() && self::hasRoute()) { - $method = self::getRoute()->getLabel('sdk', null); - /** @var \Appwrite\SDK\Method $method */ + $methods = self::getRoute()->getLabel('sdk', null); - if (empty($method)) { - $endpointIdentifier = 'unknown.unknown'; - } else { - $endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName(); + if (!\is_array($methods)) { + $methods = [$methods]; } + $params = []; + + foreach ($methods as $method) { + /** @var \Appwrite\SDK\Method $method */ + if (empty($method)) { + $endpointIdentifier = 'unknown.unknown'; + } else { + $endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName(); + } + + $params += $method->getParameters(); + } + + $parameters = array_filter($parameters, function ($key) use ($params) { + return array_key_exists($key, $params); + }, \ARRAY_FILTER_USE_KEY); + foreach ($this->getFilters() as $filter) { $parameters = $filter->parse($parameters, $endpointIdentifier); } From 9d04c61cbed6fa6f79cb893e02f6e35df1d2c8db Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 11:07:09 +0900 Subject: [PATCH 26/29] Attempt to fix tests --- src/Appwrite/Utopia/Request.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index 086d694378..f8c0439293 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -47,9 +47,11 @@ class Request extends UtopiaRequest $params += $method->getParameters(); } - $parameters = array_filter($parameters, function ($key) use ($params) { - return array_key_exists($key, $params); - }, \ARRAY_FILTER_USE_KEY); + if (!empty($params)) { + $parameters = array_filter($parameters, function ($key) use ($params) { + return array_key_exists($key, $params); + }, \ARRAY_FILTER_USE_KEY); + } foreach ($this->getFilters() as $filter) { $parameters = $filter->parse($parameters, $endpointIdentifier); From 4c220881466dd46a18e828c6e6fe7838f9d9516b Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 11:30:50 +0900 Subject: [PATCH 27/29] Address GraphQL --- src/Appwrite/GraphQL/Schema.php | 42 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index cbef55ef8d..9214bf8e20 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -105,31 +105,29 @@ class Schema continue; } - $additionalMethods = null; - if (is_array($sdk)) { - $mainSdk = array_shift($sdk); - $additionalMethods = $sdk; - - $sdk = $mainSdk; + if (!\is_array($sdk)) { + $sdk = [$sdk]; } - $namespace = $sdk->getNamespace(); - $method = $sdk->getMethodName(); - $name = $namespace . \ucfirst($method); + foreach ($sdk as $method) { + $namespace = $method->getNamespace(); + $methodName = $method->getMethodName(); + $name = $namespace . \ucfirst($methodName); - foreach (Mapper::route($utopia, $route, $complexity) as $field) { - switch ($route->getMethod()) { - case 'GET': - $queries[$name] = $field; - break; - case 'POST': - case 'PUT': - case 'PATCH': - case 'DELETE': - $mutations[$name] = $field; - break; - default: - throw new \Exception("Unsupported method: {$route->getMethod()}"); + foreach (Mapper::route($utopia, $route, $complexity) as $field) { + switch ($route->getMethod()) { + case 'GET': + $queries[$name] = $field; + break; + case 'POST': + case 'PUT': + case 'PATCH': + case 'DELETE': + $mutations[$name] = $field; + break; + default: + throw new \Exception("Unsupported method: {$route->getMethod()}"); + } } } } From 469732f482e80044b6a5128ed803ba8207311875 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 14:34:53 +0900 Subject: [PATCH 28/29] Address Comments --- app/controllers/general.php | 5 ++ app/http.php | 6 -- composer.lock | 122 +++++++++++++------------- src/Appwrite/GraphQL/Schema.php | 2 +- src/Appwrite/GraphQL/Types/Mapper.php | 29 +++--- 5 files changed, 83 insertions(+), 81 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 5457f310b3..1190f90fb0 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1128,3 +1128,8 @@ App::wildcard() foreach (Config::getParam('services', []) as $service) { include_once $service['controller']; } + +// Check for any errors found while we were initialising the SDK Methods. +if (!empty(Method::getErrors())) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); +} diff --git a/app/http.php b/app/http.php index 1ef4dcd282..641143694d 100644 --- a/app/http.php +++ b/app/http.php @@ -2,7 +2,6 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use Appwrite\SDK\Method; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Swoole\Constant; @@ -336,9 +335,4 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } }); -// Check for any errors found while we were initialising the SDK Methods. -if (!empty(Method::getErrors())) { - throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); -} - $http->start(); diff --git a/composer.lock b/composer.lock index e42376d236..1b80f15aea 100644 --- a/composer.lock +++ b/composer.lock @@ -709,16 +709,16 @@ }, { "name": "google/protobuf", - "version": "v4.29.2", + "version": "v4.29.3", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945" + "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/79aa5014efeeec3d137df5cdb0ae2fc163953945", - "reference": "79aa5014efeeec3d137df5cdb0ae2fc163953945", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", + "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", "shasum": "" }, "require": { @@ -747,9 +747,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.2" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3" }, - "time": "2024-12-18T14:11:12+00:00" + "time": "2025-01-08T21:00:13+00:00" }, { "name": "jean85/pretty-package-versions", @@ -1237,16 +1237,16 @@ }, { "name": "open-telemetry/api", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed" + "reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", - "reference": "04c85a1e41a3d59fa9bdc801a5de1df6624b95ed", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/351a30baa79699de3de3a814c8ccc7b52ccdfb1d", + "reference": "351a30baa79699de3de3a814c8ccc7b52ccdfb1d", "shasum": "" }, "require": { @@ -1303,7 +1303,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-11-16T04:32:30+00:00" + "time": "2025-01-08T23:50:34+00:00" }, { "name": "open-telemetry/context", @@ -1366,16 +1366,16 @@ }, { "name": "open-telemetry/exporter-otlp", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/exporter-otlp.git", - "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18" + "reference": "243d9657c44a06f740cf384f486afe954c2b725f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/9b6de12204f25f8ab9540b46d6e7b5151897ce18", - "reference": "9b6de12204f25f8ab9540b46d6e7b5151897ce18", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/243d9657c44a06f740cf384f486afe954c2b725f", + "reference": "243d9657c44a06f740cf384f486afe954c2b725f", "shasum": "" }, "require": { @@ -1426,20 +1426,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-04-30T18:28:30+00:00" + "time": "2025-01-08T23:50:03+00:00" }, { "name": "open-telemetry/gen-otlp-protobuf", - "version": "1.2.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", - "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d" + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/66c3b98e998a726691c92e6405a82e6e7b8b169d", - "reference": "66c3b98e998a726691c92e6405a82e6e7b8b169d", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/585bafddd4ae6565de154610b10a787a455c9ba0", + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0", "shasum": "" }, "require": { @@ -1489,20 +1489,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-10-30T11:49:49+00:00" + "time": "2025-01-15T23:07:07+00:00" }, { "name": "open-telemetry/sdk", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b" + "reference": "9a1c3b866239dbff291e5cc555bb7793eab08127" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/fb0ff8d8279a3776bd604791e2531dd0cc147e8b", - "reference": "fb0ff8d8279a3776bd604791e2531dd0cc147e8b", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/9a1c3b866239dbff291e5cc555bb7793eab08127", + "reference": "9a1c3b866239dbff291e5cc555bb7793eab08127", "shasum": "" }, "require": { @@ -1579,7 +1579,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2024-10-18T21:01:35+00:00" + "time": "2025-01-08T23:50:34+00:00" }, { "name": "open-telemetry/sem-conv", @@ -2453,16 +2453,16 @@ }, { "name": "symfony/http-client", - "version": "v7.2.1", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e" + "reference": "339ba21476eb184290361542f732ad12c97591ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/ff4df2b68d1c67abb9fef146e6540ea16b58d99e", - "reference": "ff4df2b68d1c67abb9fef146e6540ea16b58d99e", + "url": "https://api.github.com/repos/symfony/http-client/zipball/339ba21476eb184290361542f732ad12c97591ec", + "reference": "339ba21476eb184290361542f732ad12c97591ec", "shasum": "" }, "require": { @@ -2528,7 +2528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.1" + "source": "https://github.com/symfony/http-client/tree/v7.2.2" }, "funding": [ { @@ -2544,7 +2544,7 @@ "type": "tidelift" } ], - "time": "2024-12-07T08:50:44+00:00" + "time": "2024-12-30T18:35:15+00:00" }, { "name": "symfony/http-client-contracts", @@ -3929,16 +3929,16 @@ }, { "name": "utopia-php/migration", - "version": "0.6.13", + "version": "0.6.14", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "68d9b0a9477755afcda607e7e8109785cae17a13" + "reference": "59a19f09ded0ccab4c8cca35b1242c01e2b9cfd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/68d9b0a9477755afcda607e7e8109785cae17a13", - "reference": "68d9b0a9477755afcda607e7e8109785cae17a13", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/59a19f09ded0ccab4c8cca35b1242c01e2b9cfd2", + "reference": "59a19f09ded0ccab4c8cca35b1242c01e2b9cfd2", "shasum": "" }, "require": { @@ -3979,9 +3979,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.13" + "source": "https://github.com/utopia-php/migration/tree/0.6.14" }, - "time": "2024-11-26T13:57:53+00:00" + "time": "2025-01-08T01:07:25+00:00" }, { "name": "utopia-php/mongo", @@ -4095,16 +4095,16 @@ }, { "name": "utopia-php/platform", - "version": "0.7.1", + "version": "0.7.2", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "3433a0f1a54988f2a59c735f507745cb2c24638a" + "reference": "6f9243848f1c6466f6509fd01c7e18306a6d8caf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/3433a0f1a54988f2a59c735f507745cb2c24638a", - "reference": "3433a0f1a54988f2a59c735f507745cb2c24638a", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/6f9243848f1c6466f6509fd01c7e18306a6d8caf", + "reference": "6f9243848f1c6466f6509fd01c7e18306a6d8caf", "shasum": "" }, "require": { @@ -4139,9 +4139,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.7.1" + "source": "https://github.com/utopia-php/platform/tree/0.7.2" }, - "time": "2024-10-22T10:27:49+00:00" + "time": "2025-01-15T05:56:26+00:00" }, { "name": "utopia-php/pools", @@ -4807,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.28", + "version": "0.39.29", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "6ff467858fe418e364460da905139216570a5d5e" + "reference": "a9c3f6076ec162588dac7b0a741bc1a2c3d1a2b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/6ff467858fe418e364460da905139216570a5d5e", - "reference": "6ff467858fe418e364460da905139216570a5d5e", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/a9c3f6076ec162588dac7b0a741bc1a2c3d1a2b7", + "reference": "a9c3f6076ec162588dac7b0a741bc1a2c3d1a2b7", "shasum": "" }, "require": { @@ -4852,9 +4852,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.39.28" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.29" }, - "time": "2024-12-30T11:17:25+00:00" + "time": "2025-01-07T05:28:35+00:00" }, { "name": "doctrine/annotations", @@ -5126,16 +5126,16 @@ }, { "name": "laravel/pint", - "version": "v1.19.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0" + "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/8169513746e1bac70c85d6ea1524d9225d4886f0", - "reference": "8169513746e1bac70c85d6ea1524d9225d4886f0", + "url": "https://api.github.com/repos/laravel/pint/zipball/53072e8ea22213a7ed168a8a15b96fbb8b82d44b", + "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b", "shasum": "" }, "require": { @@ -5188,7 +5188,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-12-30T16:20:10+00:00" + "time": "2025-01-14T16:20:53+00:00" }, { "name": "matthiasmullie/minify", @@ -7735,16 +7735,16 @@ }, { "name": "symfony/finder", - "version": "v7.2.0", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", - "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { @@ -7779,7 +7779,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.0" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -7795,7 +7795,7 @@ "type": "tidelift" } ], - "time": "2024-10-23T06:56:12+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/options-resolver", diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index 9214bf8e20..a0d93de45c 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -114,7 +114,7 @@ class Schema $methodName = $method->getMethodName(); $name = $namespace . \ucfirst($methodName); - foreach (Mapper::route($utopia, $route, $complexity) as $field) { + foreach (Mapper::route($utopia, $route, $method, $complexity) as $field) { switch ($route->getMethod()) { case 'GET': $queries[$name] = $field; diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 4bad3e968f..e5056d0abc 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -4,6 +4,7 @@ namespace Appwrite\GraphQL\Types; use Appwrite\GraphQL\Resolvers; use Appwrite\GraphQL\Types; +use Appwrite\SDK\Method; use Exception; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; @@ -78,6 +79,7 @@ class Mapper public static function route( App $utopia, Route $route, + Method $method, callable $complexity ): iterable { foreach (self::$blacklist as $blacklist) { @@ -86,18 +88,7 @@ class Mapper } } - $sdk = $route->getLabel('sdk', false); - - if (!$sdk) { - return; - } - - if (is_array($sdk)) { - $sdk = $sdk[0]; - } - - /** @var \Appwrite\SDK\Method $sdk */ - $responses = $sdk->getResponses() ?? []; + $responses = $method->getResponses() ?? []; // If responses is an array, map each response to its model if (\is_array($responses)) { @@ -126,13 +117,25 @@ class Mapper $list = false; foreach ($route->getParams() as $name => $parameter) { + $methodParameters = $method->getParameters(); + + if (!empty($methodParameters)) { + if (!array_key_exists($name, $methodParameters)) { + continue; + } + $optional = $methodParameters[$name]['optional']; + } else { + $optional = $parameter['optional']; + } + if ($name === 'queries') { $list = true; } + $parameterType = Mapper::param( $utopia, $parameter['validator'], - !$parameter['optional'], + !$optional, $parameter['injections'] ); $params[$name] = [ From e0101def27ca5a4cf9f295376acd1df3a5d1bb5a Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 16 Jan 2025 17:47:36 +0900 Subject: [PATCH 29/29] Fix tests --- app/controllers/api/databases.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 093ba7898b..a96fb1fe66 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3109,6 +3109,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ], contentType: ContentType::JSON, parameters: [ + 'databaseId' => ['optional' => false], + 'collectionId' => ['optional' => false], 'documentId' => ['optional' => false], 'data' => ['optional' => false], 'permissions' => ['optional' => true], @@ -3127,6 +3129,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ], contentType: ContentType::JSON, parameters: [ + 'databaseId' => ['optional' => false], + 'collectionId' => ['optional' => false], 'documents' => ['optional' => false], ] )