From 89c9f1e1cd6933eb9d3b921e84081ab8d5f090d5 Mon Sep 17 00:00:00 2001 From: Wolfgang Amann <8766375+wollefitz@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:49:58 +0200 Subject: [PATCH] feat(gitlab): get and update repository files (#2300) --- .../element-templates/gitlab-connector.json | 121 +++++++++++++++--- 1 file changed, 103 insertions(+), 18 deletions(-) diff --git a/connectors/gitlab/element-templates/gitlab-connector.json b/connectors/gitlab/element-templates/gitlab-connector.json index da886b753b..e85615b0d4 100644 --- a/connectors/gitlab/element-templates/gitlab-connector.json +++ b/connectors/gitlab/element-templates/gitlab-connector.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", "name": "GitLab Outbound Connector", "id": "io.camunda.connectors.GitLab.v1", - "version": 4, + "version": 5, "description": "Administer and work with issues, releases, and more", "icon": { "contents": "data:image/svg+xml;utf8,%3Csvg width='18px' height='18px' viewBox='0 -10 256 256' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' preserveAspectRatio='xMidYMid'%3E%3Cg%3E%3Cpath d='M128.07485,236.074667 L128.07485,236.074667 L175.17885,91.1043048 L80.9708495,91.1043048 L128.07485,236.074667 L128.07485,236.074667 Z' fill='%23E24329'%3E%3C/path%3E%3Cpath d='M128.07485,236.074423 L80.9708495,91.104061 L14.9557638,91.104061 L128.07485,236.074423 L128.07485,236.074423 Z' fill='%23FC6D26'%3E%3C/path%3E%3Cpath d='M14.9558857,91.1044267 L14.9558857,91.1044267 L0.641828571,135.159589 C-0.663771429,139.17757 0.766171429,143.57955 4.18438095,146.06275 L128.074971,236.074789 L14.9558857,91.1044267 L14.9558857,91.1044267 Z' fill='%23FCA326'%3E%3C/path%3E%3Cpath d='M14.9558857,91.1045486 L80.9709714,91.1045486 L52.6000762,3.79026286 C51.1408762,-0.703146667 44.7847619,-0.701927619 43.3255619,3.79026286 L14.9558857,91.1045486 L14.9558857,91.1045486 Z' fill='%23E24329'%3E%3C/path%3E%3Cpath d='M128.07485,236.074423 L175.17885,91.104061 L241.193935,91.104061 L128.07485,236.074423 L128.07485,236.074423 Z' fill='%23FC6D26'%3E%3C/path%3E%3Cpath d='M241.193935,91.1044267 L241.193935,91.1044267 L255.507992,135.159589 C256.813592,139.17757 255.38365,143.57955 251.96544,146.06275 L128.07485,236.074789 L241.193935,91.1044267 L241.193935,91.1044267 Z' fill='%23FCA326'%3E%3C/path%3E%3Cpath d='M241.193935,91.1045486 L175.17885,91.1045486 L203.549745,3.79026286 C205.008945,-0.703146667 211.365059,-0.701927619 212.824259,3.79026286 L241.193935,91.1045486 L241.193935,91.1045486 Z' fill='%23E24329'%3E%3C/path%3E%3C/g%3E%3C/svg%3E" @@ -228,6 +228,14 @@ { "name": "Create new file in repository", "value": "createRepositoryFile" + }, + { + "name": "Get file from repository", + "value": "getRepositoryFile" + }, + { + "name": "Update existing file in repository", + "value": "updateRepositoryFile" } ], "binding": { @@ -332,6 +340,34 @@ ] } }, + { + "type": "Hidden", + "value": "get", + "binding": { + "type": "zeebe:input", + "name": "method" + }, + "condition": { + "property": "reposOperation", + "oneOf": [ + "getRepositoryFile" + ] + } + }, + { + "type": "Hidden", + "value": "put", + "binding": { + "type": "zeebe:input", + "name": "method" + }, + "condition": { + "property": "reposOperation", + "oneOf": [ + "updateRepositoryFile" + ] + } + }, { "type": "Hidden", "value": "post", @@ -425,7 +461,9 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "getRepositoryFile", + "updateRepositoryFile" ] } }, @@ -1163,7 +1201,7 @@ }, { "label": "Branch name", - "description": "Name of the new branch to create the file in. The commit is added to this branch", + "description": "Name of the new branch to modify the file in. The commit is added to this branch", "group": "operation", "type": "String", "feel": "optional", @@ -1177,13 +1215,14 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" ] } }, { "label": "Commit message", - "description": "Message of the commit that adds the new file", + "description": "Message of the commit that modifies the file", "group": "operation", "type": "String", "feel": "optional", @@ -1197,12 +1236,13 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" ] } }, { - "label": "Content", + "label": "File content", "group": "operation", "type": "Text", "feel": "optional", @@ -1216,13 +1256,14 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" ] } }, { "label": "File path", - "description": "URL-encoded full path to new file. For example, lib%2Fclass%2Erb", + "description": "URL-encoded full path to the file. For example, lib%2Fclass%2Erb", "group": "operation", "type": "String", "feel": "optional", @@ -1236,7 +1277,9 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "getRepositoryFile", + "updateRepositoryFile" ] } }, @@ -1254,7 +1297,8 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" ] } }, @@ -1272,7 +1316,8 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" ] } }, @@ -1290,7 +1335,8 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" ] } }, @@ -1308,13 +1354,14 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" ] } }, { "label": "Start branch", - "description": "Name of the branch to start the new branch from", + "description": "Name of the base branch to start the new branch from", "group": "operation", "type": "String", "feel": "optional", @@ -1326,7 +1373,28 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" + ] + } + }, + { + "label": "Reference", + "description": "Name of the branch, tag or commit the file is fetched from", + "group": "operation", + "type": "String", + "feel": "optional", + "binding": { + "type": "zeebe:input", + "name": "repositoryFileReference" + }, + "constraints": { + "notEmpty": true + }, + "condition": { + "property": "branchOperation", + "oneOf": [ + "getRepositoryFile" ] } }, @@ -1340,7 +1408,9 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "getRepositoryFile", + "updateRepositoryFile" ] } }, @@ -1354,7 +1424,22 @@ "condition": { "property": "reposOperation", "oneOf": [ - "createRepositoryFile" + "createRepositoryFile", + "updateRepositoryFile" + ] + } + }, + { + "type": "Hidden", + "value": "={\"ref\":repositoryFileReference}", + "binding": { + "type": "zeebe:input", + "name": "queryParameters" + }, + "condition": { + "property": "reposOperation", + "oneOf": [ + "getRepositoryFile" ] } },