@backstage/plugin-scaffolder-backend-module-gitlab 0.9.2-next.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"gitlabRepoPush.cjs.js","sources":["../../src/actions/gitlabRepoPush.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createTemplateAction,\n parseRepoUrl,\n serializeDirectoryContents,\n} from '@backstage/plugin-scaffolder-node';\nimport { CommitAction } from '@gitbeaker/rest';\nimport path from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-plugin-api';\nimport { createGitlabApi, getErrorMessage } from './helpers';\nimport { examples } from './gitlabRepoPush.examples';\n\n/**\n * Create a new action that commits into a gitlab repository.\n *\n * @public\n */\nexport const createGitlabRepoPushAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n branchName: string;\n commitMessage: string;\n sourcePath?: string;\n targetPath?: string;\n token?: string;\n commitAction?: 'create' | 'delete' | 'update';\n }>({\n id: 'gitlab:repo:push',\n examples,\n schema: {\n input: {\n required: ['repoUrl', 'branchName', 'commitMessage'],\n type: 'object',\n properties: {\n repoUrl: {\n type: 'string',\n title: 'Repository Location',\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n },\n branchName: {\n type: 'string',\n title: 'Source Branch Name',\n description: 'The branch name for the commit',\n },\n commitMessage: {\n type: 'string',\n title: 'Commit Message',\n description: `The commit message`,\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory to copy changes from',\n },\n targetPath: {\n type: 'string',\n title: 'Repository Subdirectory',\n description: 'Subdirectory of repository to apply changes to',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitLab',\n },\n commitAction: {\n title: 'Commit action',\n type: 'string',\n enum: ['create', 'update', 'delete'],\n description:\n 'The action to be used for git commit. Defaults to create, but can be set to update or delete',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n projectid: {\n title: 'Gitlab Project id/Name(slug)',\n type: 'string',\n },\n projectPath: {\n title: 'Gitlab Project path',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n branchName,\n repoUrl,\n targetPath,\n sourcePath,\n token,\n commitAction,\n } = ctx.input;\n\n const { owner, repo, project } = parseRepoUrl(repoUrl, integrations);\n const repoID = project ? project : `${owner}/${repo}`;\n\n const api = createGitlabApi({\n integrations,\n token,\n repoUrl,\n });\n\n let fileRoot: string;\n if (sourcePath) {\n fileRoot = resolveSafeChildPath(ctx.workspacePath, sourcePath);\n } else {\n fileRoot = ctx.workspacePath;\n }\n\n const fileContents = await serializeDirectoryContents(fileRoot, {\n gitignore: true,\n });\n\n const actions: CommitAction[] = fileContents.map(file => ({\n action: commitAction ?? 'create',\n filePath: targetPath\n ? path.posix.join(targetPath, file.path)\n : file.path,\n encoding: 'base64',\n content: file.content.toString('base64'),\n execute_filemode: file.executable,\n }));\n\n const branchExists = await ctx.checkpoint({\n key: `branch.exists.${repoID}.${branchName}`,\n fn: async () => {\n try {\n await api.Branches.show(repoID, branchName);\n return true;\n } catch (e: any) {\n if (e.cause?.response?.status !== 404) {\n throw new InputError(\n `Failed to check status of branch '${branchName}'. Please make sure that branch already exists or Backstage has permissions to create one. ${getErrorMessage(\n e,\n )}`,\n );\n }\n }\n return false;\n },\n });\n\n if (!branchExists) {\n // create a branch using the default branch as ref\n try {\n const projects = await api.Projects.show(repoID);\n const { default_branch: defaultBranch } = projects;\n await api.Branches.create(repoID, branchName, String(defaultBranch));\n } catch (e) {\n throw new InputError(\n `The branch '${branchName}' was not found and creation failed with error. Please make sure that branch already exists or Backstage has permissions to create one. ${getErrorMessage(\n e,\n )}`,\n );\n }\n }\n\n try {\n const commitId = await ctx.checkpoint({\n key: `commit.create.${repoID}.${branchName}`,\n fn: async () => {\n const commit = await api.Commits.create(\n repoID,\n branchName,\n ctx.input.commitMessage,\n actions,\n );\n return commit.id;\n },\n });\n\n ctx.output('projectid', repoID);\n ctx.output('projectPath', repoID);\n ctx.output('commitHash', commitId);\n } catch (e) {\n if (commitAction !== 'create') {\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please verify that all files you're trying to modify exist in the repository. ${getErrorMessage(\n e,\n )}`,\n );\n }\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${getErrorMessage(\n e,\n )}`,\n );\n }\n },\n });\n};\n"],"names":["createTemplateAction","examples","parseRepoUrl","createGitlabApi","resolveSafeChildPath","serializeDirectoryContents","path","InputError","getErrorMessage"],"mappings":";;;;;;;;;;;;;AAkCa,MAAA,0BAAA,GAA6B,CAAC,OAErC,KAAA;AACJ,EAAM,MAAA,EAAE,cAAiB,GAAA,OAAA;AAEzB,EAAA,OAAOA,yCAQJ,CAAA;AAAA,IACD,EAAI,EAAA,kBAAA;AAAA,cACJC,gCAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,QAAU,EAAA,CAAC,SAAW,EAAA,YAAA,EAAc,eAAe,CAAA;AAAA,QACnD,IAAM,EAAA,QAAA;AAAA,QACN,UAAY,EAAA;AAAA,UACV,OAAS,EAAA;AAAA,YACP,IAAM,EAAA,QAAA;AAAA,YACN,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A,UAAA;AAAA,cACA,IAAI,KAAM,CAAA,aAAA;AAAA,cACV;AAAA,aACF;AACA,YAAA,OAAO,MAAO,CAAA,EAAA;AAAA;AAChB,SACD,CAAA;AAED,QAAI,GAAA,CAAA,MAAA,CAAO,aAAa,MAAM,CAAA;AAC9B,QAAI,GAAA,CAAA,MAAA,CAAO,eAAe,MAAM,CAAA;AAChC,QAAI,GAAA,CAAA,MAAA,CAAO,cAAc,QAAQ,CAAA;AAAA,eAC1B,CAAG,EAAA;AACV,QAAA,IAAI,iBAAiB,QAAU,EAAA;AAC7B,UAAA,MAAM,IAAID,iBAAA;AAAA,YACR,CAAA,0BAAA,EAA6B,UAAU,CAA0F,uFAAA,EAAAC,uBAAA;AAAA,cAC/H;AAAA,aACD,CAAA;AAAA,WACH;AAAA;AAEF,QAAA,MAAM,IAAID,iBAAA;AAAA,UACR,CAAA,0BAAA,EAA6B,UAAU,CAAwF,qFAAA,EAAAC,uBAAA;AAAA,YAC7H;AAAA,WACD,CAAA;AAAA,SACH;AAAA;AACF;AACF,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"gitlabRepoPush.cjs.js","sources":["../../src/actions/gitlabRepoPush.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-plugin-api';\nimport {\n createTemplateAction,\n parseRepoUrl,\n serializeDirectoryContents,\n} from '@backstage/plugin-scaffolder-node';\nimport { CommitAction } from '@gitbeaker/rest';\nimport { createGitlabApi, getErrorMessage } from './helpers';\nimport { examples } from './gitlabRepoPush.examples';\n\n/**\n * Create a new action that commits into a gitlab repository.\n *\n * @public\n */\nexport const createGitlabRepoPushAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction({\n id: 'gitlab:repo:push',\n examples,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n }),\n branchName: z =>\n z.string({\n description: 'The branch name for the commit',\n }),\n commitMessage: z =>\n z.string({\n description: `The commit message`,\n }),\n sourcePath: z =>\n z\n .string({\n description:\n 'Subdirectory of working directory to copy changes from',\n })\n .optional(),\n targetPath: z =>\n z\n .string({\n description: 'Subdirectory of repository to apply changes to',\n })\n .optional(),\n token: z =>\n z\n .string({\n description: 'The token to use for authorization to GitLab',\n })\n .optional(),\n commitAction: z =>\n z\n .enum(['create', 'update', 'delete'], {\n description:\n 'The action to be used for git commit. Defaults to create, but can be set to update or delete',\n })\n .optional(),\n },\n output: {\n projectid: z =>\n z.string({\n description: 'Gitlab Project id/Name(slug)',\n }),\n projectPath: z =>\n z.string({\n description: 'Gitlab Project path',\n }),\n commitHash: z =>\n z.string({\n description: 'The git commit hash of the commit',\n }),\n },\n },\n async handler(ctx) {\n const {\n branchName,\n repoUrl,\n targetPath,\n sourcePath,\n token,\n commitAction,\n } = ctx.input;\n\n const { owner, repo, project } = parseRepoUrl(repoUrl, integrations);\n const repoID = project ? project : `${owner}/${repo}`;\n\n const api = createGitlabApi({\n integrations,\n token,\n repoUrl,\n });\n\n let fileRoot: string;\n if (sourcePath) {\n fileRoot = resolveSafeChildPath(ctx.workspacePath, sourcePath);\n } else {\n fileRoot = ctx.workspacePath;\n }\n\n const fileContents = await serializeDirectoryContents(fileRoot, {\n gitignore: true,\n });\n\n const actions: CommitAction[] = fileContents.map(file => ({\n action: commitAction ?? 'create',\n filePath: targetPath\n ? path.posix.join(targetPath, file.path)\n : file.path,\n encoding: 'base64',\n content: file.content.toString('base64'),\n execute_filemode: file.executable,\n }));\n\n const branchExists = await ctx.checkpoint({\n key: `branch.exists.${repoID}.${branchName}`,\n fn: async () => {\n try {\n await api.Branches.show(repoID, branchName);\n return true;\n } catch (e: any) {\n if (e.cause?.response?.status !== 404) {\n throw new InputError(\n `Failed to check status of branch '${branchName}'. Please make sure that branch already exists or Backstage has permissions to create one. ${getErrorMessage(\n e,\n )}`,\n );\n }\n }\n return false;\n },\n });\n\n if (!branchExists) {\n // create a branch using the default branch as ref\n try {\n const projects = await api.Projects.show(repoID);\n const { default_branch: defaultBranch } = projects;\n await api.Branches.create(repoID, branchName, String(defaultBranch));\n } catch (e) {\n throw new InputError(\n `The branch '${branchName}' was not found and creation failed with error. Please make sure that branch already exists or Backstage has permissions to create one. ${getErrorMessage(\n e,\n )}`,\n );\n }\n }\n\n try {\n const commitId = await ctx.checkpoint({\n key: `commit.create.${repoID}.${branchName}`,\n fn: async () => {\n const commit = await api.Commits.create(\n repoID,\n branchName,\n ctx.input.commitMessage,\n actions,\n );\n return commit.id;\n },\n });\n\n ctx.output('projectid', repoID);\n ctx.output('projectPath', repoID);\n ctx.output('commitHash', commitId);\n } catch (e) {\n if (commitAction !== 'create') {\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please verify that all files you're trying to modify exist in the repository. ${getErrorMessage(\n e,\n )}`,\n );\n }\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${getErrorMessage(\n e,\n )}`,\n );\n }\n },\n });\n};\n"],"names":["createTemplateAction","examples","parseRepoUrl","createGitlabApi","resolveSafeChildPath","serializeDirectoryContents","path","InputError","getErrorMessage"],"mappings":";;;;;;;;;;;;;AAkCa,MAAA,0BAAA,GAA6B,CAAC,OAErC,KAAA;AACJ,EAAM,MAAA,EAAE,cAAiB,GAAA,OAAA;AAEzB,EAAA,OAAOA,yCAAqB,C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AA,MAAA,GAAS,MAAM,GAAA,CAAI,OAAQ,CAAA,MAAA;AAAA,cAC/B,MAAA;AAAA,cACA,UAAA;AAAA,cACA,IAAI,KAAM,CAAA,aAAA;AAAA,cACV;AAAA,aACF;AACA,YAAA,OAAO,MAAO,CAAA,EAAA;AAAA;AAChB,SACD,CAAA;AAED,QAAI,GAAA,CAAA,MAAA,CAAO,aAAa,MAAM,CAAA;AAC9B,QAAI,GAAA,CAAA,MAAA,CAAO,eAAe,MAAM,CAAA;AAChC,QAAI,GAAA,CAAA,MAAA,CAAO,cAAc,QAAQ,CAAA;AAAA,eAC1B,CAAG,EAAA;AACV,QAAA,IAAI,iBAAiB,QAAU,EAAA;AAC7B,UAAA,MAAM,IAAID,iBAAA;AAAA,YACR,CAAA,0BAAA,EAA6B,UAAU,CAA0F,uFAAA,EAAAC,uBAAA;AAAA,cAC/H;AAAA,aACD,CAAA;AAAA,WACH;AAAA;AAEF,QAAA,MAAM,IAAID,iBAAA;AAAA,UACR,CAAA,0BAAA,EAA6B,UAAU,CAAwF,qFAAA,EAAAC,uBAAA;AAAA,YAC7H;AAAA,WACD,CAAA;AAAA,SACH;AAAA;AACF;AACF,GACD,CAAA;AACH;;;;"}
@@ -1,10 +1,8 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var zod = require('zod');
6
4
 
7
- const commonGitlabConfig = zod.z.object({
5
+ zod.z.object({
8
6
  repoUrl: zod.z.string({ description: "Repository Location" }),
9
7
  token: zod.z.string({ description: "The token to use for authorization to GitLab" }).optional()
10
8
  });
@@ -28,5 +26,4 @@ var IssueStateEvent = /* @__PURE__ */ ((IssueStateEvent2) => {
28
26
  exports.IssueStateEvent = IssueStateEvent;
29
27
  exports.IssueType = IssueType;
30
28
  exports.commonGitlabConfigExample = commonGitlabConfigExample;
31
- exports.default = commonGitlabConfig;
32
29
  //# sourceMappingURL=commonGitlabConfig.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commonGitlabConfig.cjs.js","sources":["../src/commonGitlabConfig.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod';\n\nconst commonGitlabConfig = z.object({\n repoUrl: z.string({ description: 'Repository Location' }),\n token: z\n .string({ description: 'The token to use for authorization to GitLab' })\n .optional(),\n});\n\nexport default commonGitlabConfig;\n\nexport const commonGitlabConfigExample = {\n repoUrl: 'gitlab.com?owner=namespace-or-owner&repo=project-name',\n token: '${{ secrets.USER_OAUTH_TOKEN }}',\n};\n\n/**\n * Gitlab issue types as specified by gitlab api\n *\n * @public\n */\nexport enum IssueType {\n ISSUE = 'issue',\n INCIDENT = 'incident',\n TEST = 'test_case',\n TASK = 'task',\n}\n\n/**\n * Gitlab issue state events for modifications\n *\n * @public\n */\nexport enum IssueStateEvent {\n CLOSE = 'close',\n REOPEN = 'reopen',\n}\n"],"names":["z","IssueType","IssueStateEvent"],"mappings":";;;;;;AAkBM,MAAA,kBAAA,GAAqBA,MAAE,MAAO,CAAA;AAAA,EAClC,SAASA,KAAE,CAAA,MAAA,CAAO,EAAE,WAAA,EAAa,uBAAuB,CAAA;AAAA,EACxD,KAAA,EAAOA,MACJ,MAAO,CAAA,EAAE,aAAa,8CAA+C,EAAC,EACtE,QAAS;AACd,CAAC;AAIM,MAAM,yBAA4B,GAAA;AAAA,EACvC,OAAS,EAAA,uDAAA;AAAA,EACT,KAAO,EAAA;AACT;AAOY,IAAA,SAAA,qBAAAC,UAAL,KAAA;AACL,EAAAA,WAAA,OAAQ,CAAA,GAAA,OAAA;AACR,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAAA,WAAA,MAAO,CAAA,GAAA,WAAA;AACP,EAAAA,WAAA,MAAO,CAAA,GAAA,MAAA;AAJG,EAAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAYA,IAAA,eAAA,qBAAAC,gBAAL,KAAA;AACL,EAAAA,iBAAA,OAAQ,CAAA,GAAA,OAAA;AACR,EAAAA,iBAAA,QAAS,CAAA,GAAA,QAAA;AAFC,EAAAA,OAAAA,gBAAAA;AAAA,CAAA,EAAA,eAAA,IAAA,EAAA;;;;;;;"}
1
+ {"version":3,"file":"commonGitlabConfig.cjs.js","sources":["../src/commonGitlabConfig.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod';\n\nconst commonGitlabConfig = z.object({\n repoUrl: z.string({ description: 'Repository Location' }),\n token: z\n .string({ description: 'The token to use for authorization to GitLab' })\n .optional(),\n});\n\nexport default commonGitlabConfig;\n\nexport const commonGitlabConfigExample = {\n repoUrl: 'gitlab.com?owner=namespace-or-owner&repo=project-name',\n token: '${{ secrets.USER_OAUTH_TOKEN }}',\n};\n\n/**\n * Gitlab issue types as specified by gitlab api\n *\n * @public\n */\nexport enum IssueType {\n ISSUE = 'issue',\n INCIDENT = 'incident',\n TEST = 'test_case',\n TASK = 'task',\n}\n\n/**\n * Gitlab issue state events for modifications\n *\n * @public\n */\nexport enum IssueStateEvent {\n CLOSE = 'close',\n REOPEN = 'reopen',\n}\n"],"names":["z","IssueType","IssueStateEvent"],"mappings":";;;;AAkB2BA,MAAE,MAAO,CAAA;AAAA,EAClC,SAASA,KAAE,CAAA,MAAA,CAAO,EAAE,WAAA,EAAa,uBAAuB,CAAA;AAAA,EACxD,KAAA,EAAOA,MACJ,MAAO,CAAA,EAAE,aAAa,8CAA+C,EAAC,EACtE,QAAS;AACd,CAAC;AAIM,MAAM,yBAA4B,GAAA;AAAA,EACvC,OAAS,EAAA,uDAAA;AAAA,EACT,KAAO,EAAA;AACT;AAOY,IAAA,SAAA,qBAAAC,UAAL,KAAA;AACL,EAAAA,WAAA,OAAQ,CAAA,GAAA,OAAA;AACR,EAAAA,WAAA,UAAW,CAAA,GAAA,UAAA;AACX,EAAAA,WAAA,MAAO,CAAA,GAAA,WAAA;AACP,EAAAA,WAAA,MAAO,CAAA,GAAA,MAAA;AAJG,EAAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAYA,IAAA,eAAA,qBAAAC,gBAAL,KAAA;AACL,EAAAA,iBAAA,OAAQ,CAAA,GAAA,OAAA;AACR,EAAAA,iBAAA,QAAS,CAAA,GAAA,QAAA;AAFC,EAAAA,OAAAA,gBAAAA;AAAA,CAAA,EAAA,eAAA,IAAA,EAAA;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
2
- import * as _backstage_types from '@backstage/types';
3
2
  import { ScmIntegrationRegistry } from '@backstage/integration';
4
3
  import { Config } from '@backstage/config';
5
4
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
@@ -15,49 +14,53 @@ declare function createPublishGitlabAction(options: {
15
14
  config: Config;
16
15
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
17
16
  repoUrl: string;
18
- defaultBranch?: string;
19
- /** @deprecated in favour of settings.visibility field */
20
- repoVisibility?: "private" | "internal" | "public";
21
- sourcePath?: string | boolean;
22
- skipExisting?: boolean;
23
- token?: string;
24
- gitCommitMessage?: string;
25
- gitAuthorName?: string;
26
- gitAuthorEmail?: string;
27
- signCommit?: boolean;
28
- setUserAsOwner?: boolean;
29
- /** @deprecated in favour of settings.topics field */
30
- topics?: string[];
17
+ repoVisibility?: "internal" | "private" | "public" | undefined;
18
+ defaultBranch?: string | undefined;
19
+ gitCommitMessage?: string | undefined;
20
+ gitAuthorName?: string | undefined;
21
+ gitAuthorEmail?: string | undefined;
22
+ signCommit?: boolean | undefined;
23
+ sourcePath?: string | boolean | undefined;
24
+ skipExisting?: boolean | undefined;
25
+ token?: string | undefined;
26
+ setUserAsOwner?: boolean | undefined;
27
+ topics?: string[] | undefined;
31
28
  settings?: {
32
- path?: string;
33
- auto_devops_enabled?: boolean;
34
- ci_config_path?: string;
35
- description?: string;
36
- merge_method?: "merge" | "rebase_merge" | "ff";
37
- squash_option?: "default_off" | "default_on" | "never" | "always";
38
- topics?: string[];
39
- visibility?: "private" | "internal" | "public";
40
- only_allow_merge_if_all_discussions_are_resolved?: boolean;
41
- only_allow_merge_if_pipeline_succeeds?: boolean;
42
- allow_merge_on_skipped_pipeline?: boolean;
43
- };
44
- branches?: Array<{
29
+ visibility?: "internal" | "private" | "public" | undefined;
30
+ path?: string | undefined;
31
+ description?: string | undefined;
32
+ merge_method?: "merge" | "rebase_merge" | "ff" | undefined;
33
+ topics?: string[] | undefined;
34
+ auto_devops_enabled?: boolean | undefined;
35
+ only_allow_merge_if_pipeline_succeeds?: boolean | undefined;
36
+ allow_merge_on_skipped_pipeline?: boolean | undefined;
37
+ only_allow_merge_if_all_discussions_are_resolved?: boolean | undefined;
38
+ squash_option?: "always" | "never" | "default_on" | "default_off" | undefined;
39
+ ci_config_path?: string | undefined;
40
+ } | undefined;
41
+ branches?: {
45
42
  name: string;
46
- protect?: boolean;
47
- create?: boolean;
48
- ref?: string;
49
- }>;
50
- projectVariables?: Array<{
43
+ ref?: string | undefined;
44
+ create?: boolean | undefined;
45
+ protect?: boolean | undefined;
46
+ }[] | undefined;
47
+ projectVariables?: {
51
48
  key: string;
52
49
  value: string;
53
- description?: string;
54
- variable_type?: string;
55
- protected?: boolean;
56
- masked?: boolean;
57
- raw?: boolean;
58
- environment_scope?: string;
59
- }>;
60
- }, _backstage_types.JsonObject, "v1">;
50
+ raw?: boolean | undefined;
51
+ description?: string | undefined;
52
+ protected?: boolean | undefined;
53
+ variable_type?: "file" | "env_var" | undefined;
54
+ masked?: boolean | undefined;
55
+ environment_scope?: string | undefined;
56
+ }[] | undefined;
57
+ }, {
58
+ remoteUrl: string;
59
+ repoContentsUrl: string;
60
+ projectId: number;
61
+ commitHash: string;
62
+ created: boolean;
63
+ }, "v2">;
61
64
 
62
65
  /**
63
66
  * Creates an `gitlab:group:ensureExists` Scaffolder action.
@@ -67,15 +70,15 @@ declare function createPublishGitlabAction(options: {
67
70
  declare const createGitlabGroupEnsureExistsAction: (options: {
68
71
  integrations: ScmIntegrationRegistry;
69
72
  }) => _backstage_plugin_scaffolder_node.TemplateAction<{
73
+ repoUrl: string;
70
74
  path: (string | {
71
75
  name: string;
72
76
  slug: string;
73
77
  })[];
74
- repoUrl: string;
75
78
  token?: string | undefined;
76
79
  }, {
77
80
  groupId?: number | undefined;
78
- }, "v1">;
81
+ }, "v2">;
79
82
 
80
83
  /**
81
84
  * Gitlab issue types as specified by gitlab api
@@ -107,27 +110,27 @@ declare enum IssueStateEvent {
107
110
  declare const createGitlabIssueAction: (options: {
108
111
  integrations: ScmIntegrationRegistry;
109
112
  }) => _backstage_plugin_scaffolder_node.TemplateAction<{
110
- title: string;
111
113
  repoUrl: string;
112
114
  projectId: number;
113
- labels?: string | undefined;
114
- description?: string | undefined;
115
- weight?: number | undefined;
115
+ title: string;
116
116
  token?: string | undefined;
117
117
  assignees?: number[] | undefined;
118
- createdAt?: string | undefined;
119
118
  confidential?: boolean | undefined;
120
- milestoneId?: number | undefined;
121
- epicId?: number | undefined;
119
+ description?: string | undefined;
120
+ createdAt?: string | undefined;
122
121
  dueDate?: string | undefined;
123
122
  discussionToResolve?: string | undefined;
123
+ epicId?: number | undefined;
124
+ labels?: string | undefined;
124
125
  issueType?: IssueType | undefined;
125
126
  mergeRequestToResolveDiscussionsOf?: number | undefined;
127
+ milestoneId?: number | undefined;
128
+ weight?: number | undefined;
126
129
  }, {
127
130
  issueUrl: string;
128
131
  issueId: number;
129
132
  issueIid: number;
130
- }, "v1">;
133
+ }, "v2">;
131
134
 
132
135
  /**
133
136
  * Creates a `gitlab:issue:edit` Scaffolder action.
@@ -141,31 +144,31 @@ declare const editGitlabIssueAction: (options: {
141
144
  repoUrl: string;
142
145
  projectId: number;
143
146
  issueIid: number;
144
- title?: string | undefined;
145
- labels?: string | undefined;
146
- description?: string | undefined;
147
- weight?: number | undefined;
148
147
  token?: string | undefined;
149
- assignees?: number[] | undefined;
150
148
  addLabels?: string | undefined;
149
+ assignees?: number[] | undefined;
151
150
  confidential?: boolean | undefined;
151
+ description?: string | undefined;
152
+ discussionLocked?: boolean | undefined;
153
+ dueDate?: string | undefined;
154
+ epicId?: number | undefined;
155
+ issueType?: IssueType | undefined;
156
+ labels?: string | undefined;
152
157
  milestoneId?: number | undefined;
153
158
  removeLabels?: string | undefined;
154
159
  stateEvent?: IssueStateEvent | undefined;
155
- discussionLocked?: boolean | undefined;
156
- epicId?: number | undefined;
157
- dueDate?: string | undefined;
160
+ title?: string | undefined;
158
161
  updatedAt?: string | undefined;
159
- issueType?: IssueType | undefined;
162
+ weight?: number | undefined;
160
163
  }, {
161
- state: string;
162
- title: string;
163
- projectId: number;
164
- updatedAt: string;
165
164
  issueUrl: string;
165
+ projectId: number;
166
166
  issueId: number;
167
167
  issueIid: number;
168
- }, "v1">;
168
+ state: string;
169
+ title: string;
170
+ updatedAt: string;
171
+ }, "v2">;
169
172
 
170
173
  /**
171
174
  * Create a new action that creates a GitLab merge request.
@@ -206,15 +209,15 @@ declare const createPublishGitlabMergeRequestAction: (options: {
206
209
  declare const createTriggerGitlabPipelineAction: (options: {
207
210
  integrations: ScmIntegrationRegistry;
208
211
  }) => _backstage_plugin_scaffolder_node.TemplateAction<{
209
- branch: string;
210
212
  repoUrl: string;
211
213
  projectId: number;
212
214
  tokenDescription: string;
215
+ branch: string;
213
216
  token?: string | undefined;
214
217
  variables?: Record<string, string> | undefined;
215
218
  }, {
216
219
  pipelineUrl: string;
217
- }, "v1">;
220
+ }, "v2">;
218
221
 
219
222
  /**
220
223
  * Creates a `gitlab:projectAccessToken:create` Scaffolder action.
@@ -225,16 +228,16 @@ declare const createTriggerGitlabPipelineAction: (options: {
225
228
  declare const createGitlabProjectAccessTokenAction: (options: {
226
229
  integrations: ScmIntegrationRegistry;
227
230
  }) => _backstage_plugin_scaffolder_node.TemplateAction<{
228
- repoUrl: string;
229
231
  projectId: string | number;
230
- name?: string | undefined;
232
+ repoUrl: string;
231
233
  token?: string | undefined;
234
+ name?: string | undefined;
235
+ accessLevel?: number | undefined;
232
236
  scopes?: string[] | undefined;
233
237
  expiresAt?: string | undefined;
234
- accessLevel?: number | undefined;
235
238
  }, {
236
239
  access_token: string;
237
- }, "v1">;
240
+ }, "v2">;
238
241
 
239
242
  /**
240
243
  * Creates a `gitlab:projectDeployToken:create` Scaffolder action.
@@ -245,16 +248,16 @@ declare const createGitlabProjectAccessTokenAction: (options: {
245
248
  declare const createGitlabProjectDeployTokenAction: (options: {
246
249
  integrations: ScmIntegrationRegistry;
247
250
  }) => _backstage_plugin_scaffolder_node.TemplateAction<{
248
- name: string;
249
- scopes: string[];
250
251
  repoUrl: string;
251
252
  projectId: string | number;
252
- username?: string | undefined;
253
+ name: string;
254
+ scopes: string[];
253
255
  token?: string | undefined;
256
+ username?: string | undefined;
254
257
  }, {
255
- user: string;
256
258
  deploy_token: string;
257
- }, "v1">;
259
+ user: string;
260
+ }, "v2">;
258
261
 
259
262
  /**
260
263
  * Creates a `gitlab:projectVariable:create` Scaffolder action.
@@ -265,17 +268,19 @@ declare const createGitlabProjectDeployTokenAction: (options: {
265
268
  declare const createGitlabProjectVariableAction: (options: {
266
269
  integrations: ScmIntegrationRegistry;
267
270
  }) => _backstage_plugin_scaffolder_node.TemplateAction<{
268
- key: string;
269
- value: string;
270
271
  repoUrl: string;
271
272
  projectId: string | number;
273
+ key: string;
274
+ value: string;
272
275
  variableType: string;
273
- raw?: boolean | undefined;
274
276
  token?: string | undefined;
277
+ variableProtected?: boolean | undefined;
275
278
  masked?: boolean | undefined;
279
+ raw?: boolean | undefined;
276
280
  environmentScope?: string | undefined;
277
- variableProtected?: boolean | undefined;
278
- }, any, "v1">;
281
+ }, {
282
+ [x: string]: any;
283
+ }, "v2">;
279
284
 
280
285
  /**
281
286
  * Create a new action that commits into a gitlab repository.
@@ -288,11 +293,15 @@ declare const createGitlabRepoPushAction: (options: {
288
293
  repoUrl: string;
289
294
  branchName: string;
290
295
  commitMessage: string;
291
- sourcePath?: string;
292
- targetPath?: string;
293
- token?: string;
294
- commitAction?: "create" | "delete" | "update";
295
- }, _backstage_types.JsonObject, "v1">;
296
+ sourcePath?: string | undefined;
297
+ targetPath?: string | undefined;
298
+ token?: string | undefined;
299
+ commitAction?: "update" | "delete" | "create" | undefined;
300
+ }, {
301
+ projectid: string;
302
+ projectPath: string;
303
+ commitHash: string;
304
+ }, "v2">;
296
305
 
297
306
  /**
298
307
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-gitlab",
3
- "version": "0.9.2-next.1",
3
+ "version": "0.9.2",
4
4
  "backstage": {
5
5
  "role": "backend-plugin-module",
6
6
  "pluginId": "scaffolder",
@@ -53,11 +53,11 @@
53
53
  "test": "backstage-cli package test"
54
54
  },
55
55
  "dependencies": {
56
- "@backstage/backend-plugin-api": "1.4.0-next.1",
57
- "@backstage/config": "1.3.2",
58
- "@backstage/errors": "1.2.7",
59
- "@backstage/integration": "1.17.0",
60
- "@backstage/plugin-scaffolder-node": "0.8.3-next.1",
56
+ "@backstage/backend-plugin-api": "^1.4.0",
57
+ "@backstage/config": "^1.3.2",
58
+ "@backstage/errors": "^1.2.7",
59
+ "@backstage/integration": "^1.17.0",
60
+ "@backstage/plugin-scaffolder-node": "^0.9.0",
61
61
  "@gitbeaker/rest": "^41.2.0",
62
62
  "luxon": "^3.0.0",
63
63
  "winston": "^3.2.1",
@@ -65,9 +65,8 @@
65
65
  "zod": "^3.22.4"
66
66
  },
67
67
  "devDependencies": {
68
- "@backstage/backend-test-utils": "1.6.0-next.1",
69
- "@backstage/cli": "0.32.2-next.0",
70
- "@backstage/core-app-api": "1.17.0",
71
- "@backstage/plugin-scaffolder-node-test-utils": "0.2.3-next.1"
68
+ "@backstage/backend-test-utils": "^1.6.0",
69
+ "@backstage/cli": "^0.33.0",
70
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.3.0"
72
71
  }
73
72
  }