From c83dd7aa1396d75d0f695ac6ee250ec1061e9b4b Mon Sep 17 00:00:00 2001 From: hmacr Date: Wed, 23 Jul 2025 11:45:27 +0530 Subject: [PATCH 1/2] Add defaultBranch in getRepository response --- app/config/specs/open-api3-latest-client.json | 24 +++++++++++++++++++ .../specs/open-api3-latest-console.json | 18 ++++++++++++++ app/config/specs/swagger2-latest-client.json | 24 +++++++++++++++++++ app/config/specs/swagger2-latest-console.json | 18 ++++++++++++++ app/controllers/api/vcs.php | 1 + .../Response/Model/ProviderRepository.php | 6 +++++ 6 files changed, 91 insertions(+) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index d09108e51d..f004aaa883 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4492,6 +4492,30 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Admin": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index b7450bc7e6..7a16af6a76 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -39702,6 +39702,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39714,6 +39719,7 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" ] }, @@ -39746,6 +39752,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39763,6 +39774,7 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" ] @@ -39796,6 +39808,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39813,6 +39830,7 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" ] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index c3353e157f..a75d9828b0 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4629,6 +4629,30 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Admin": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 4fa839aa39..271d1d5ee9 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -39878,6 +39878,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39890,6 +39895,7 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt" ] }, @@ -39922,6 +39928,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39939,6 +39950,7 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "framework" ] @@ -39972,6 +39984,11 @@ "description": "Is VCS (Version Control System) repository private?", "x-example": true }, + "defaultBranch": { + "type": "string", + "description": "VCS (Version Control System) repository's default branch name.", + "x-example": "main" + }, "pushedAt": { "type": "string", "description": "Last commit date in ISO 8601 format.", @@ -39989,6 +40006,7 @@ "organization", "provider", "private", + "defaultBranch", "pushedAt", "runtime" ] diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index a8efd093b5..6126a4f7b1 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -1137,6 +1137,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro $repository['pushedAt'] = $repository['pushed_at'] ?? ''; $repository['organization'] = $installation->getAttribute('organization', ''); $repository['provider'] = $installation->getAttribute('provider', ''); + $repository['defaultBranch'] = $repository["default_branch"] ?? ''; $response->dynamic(new Document($repository), Response::MODEL_PROVIDER_REPOSITORY); }); diff --git a/src/Appwrite/Utopia/Response/Model/ProviderRepository.php b/src/Appwrite/Utopia/Response/Model/ProviderRepository.php index 518b5de9ee..eee058a05b 100644 --- a/src/Appwrite/Utopia/Response/Model/ProviderRepository.php +++ b/src/Appwrite/Utopia/Response/Model/ProviderRepository.php @@ -41,6 +41,12 @@ class ProviderRepository extends Model 'default' => false, 'example' => true, ]) + ->addRule('defaultBranch', [ + 'type' => self::TYPE_STRING, + 'description' => "VCS (Version Control System) repository's default branch name.", + 'default' => '', + 'example' => 'main', + ]) ->addRule('pushedAt', [ 'type' => self::TYPE_DATETIME, 'description' => 'Last commit date in ISO 8601 format.', From a8d5fc99982ffdcd56a87284af49b54e6b66c7f5 Mon Sep 17 00:00:00 2001 From: hmacr Date: Thu, 24 Jul 2025 19:49:52 +0530 Subject: [PATCH 2/2] format --- app/controllers/api/vcs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index b9b8f0d3f0..9271e87448 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -1137,7 +1137,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro $repository['pushedAt'] = $repository['pushed_at'] ?? ''; $repository['organization'] = $installation->getAttribute('organization', ''); $repository['provider'] = $installation->getAttribute('provider', ''); - $repository['defaultBranch'] = $repository["default_branch"] ?? ''; + $repository['defaultBranch'] = $repository['default_branch'] ?? ''; $response->dynamic(new Document($repository), Response::MODEL_PROVIDER_REPOSITORY); });