@backstage/plugin-scaffolder-backend-module-bitbucket 0.3.12 → 0.3.13

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-bitbucket
2
2
 
3
+ ## 0.3.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-scaffolder-node@0.11.0
9
+ - @backstage/backend-plugin-api@1.4.2
10
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.2.12
11
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.2.12
12
+
13
+ ## 0.3.13-next.0
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+ - @backstage/plugin-scaffolder-node@0.11.0-next.0
19
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-cloud@0.2.12-next.0
20
+ - @backstage/plugin-scaffolder-backend-module-bitbucket-server@0.2.12-next.0
21
+ - @backstage/backend-plugin-api@1.4.2-next.0
22
+ - @backstage/config@1.3.3
23
+ - @backstage/errors@1.2.7
24
+ - @backstage/integration@1.17.1
25
+
3
26
  ## 0.3.12
4
27
 
5
28
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"bitbucket.cjs.js","sources":["../../src/actions/bitbucket.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 { InputError } from '@backstage/errors';\nimport {\n BitbucketIntegrationConfig,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n getRepoSourceDirectory,\n initRepoAndPush,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { Config } from '@backstage/config';\nimport { examples } from './bitbucket.examples';\n\nconst createBitbucketCloudRepository = async (opts: {\n workspace: string;\n project: string;\n repo: string;\n description?: string;\n repoVisibility: 'private' | 'public';\n mainBranch: string;\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n workspace,\n project,\n repo,\n description,\n repoVisibility,\n mainBranch,\n authorization,\n apiBaseUrl,\n } = opts;\n\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n scm: 'git',\n description: description,\n is_private: repoVisibility === 'private',\n project: { key: project },\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n let response: Response;\n try {\n response = await fetch(\n `${apiBaseUrl}/repositories/${workspace}/${repo}`,\n options,\n );\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n\n if (response.status !== 200) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n let remoteUrl = '';\n for (const link of r.links.clone) {\n if (link.name === 'https') {\n remoteUrl = link.href;\n }\n }\n\n // \"mainbranch.name\" cannot be set neither at create nor update of the repo\n // the first pushed branch will be set as \"main branch\" then\n const repoContentsUrl = `${r.links.html.href}/src/${mainBranch}`;\n return { remoteUrl, repoContentsUrl };\n};\n\nconst createBitbucketServerRepository = async (opts: {\n project: string;\n repo: string;\n description?: string;\n repoVisibility: 'private' | 'public';\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n project,\n repo,\n description,\n authorization,\n repoVisibility,\n apiBaseUrl,\n } = opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: repo,\n description: description,\n public: repoVisibility === 'public',\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(`${apiBaseUrl}/projects/${project}/repos`, options);\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n let remoteUrl = '';\n for (const link of r.links.clone) {\n if (link.name === 'http') {\n remoteUrl = link.href;\n }\n }\n\n const repoContentsUrl = `${r.links.self[0].href}`;\n return { remoteUrl, repoContentsUrl };\n};\n\nconst getAuthorizationHeader = (config: BitbucketIntegrationConfig) => {\n if (config.username && config.appPassword) {\n const buffer = Buffer.from(\n `${config.username}:${config.appPassword}`,\n 'utf8',\n );\n\n return `Basic ${buffer.toString('base64')}`;\n }\n\n if (config.token) {\n return `Bearer ${config.token}`;\n }\n\n throw new Error(\n `Authorization has not been provided for Bitbucket. Please add either username + appPassword or token to the Integrations config`,\n );\n};\n\nconst performEnableLFS = async (opts: {\n authorization: string;\n host: string;\n project: string;\n repo: string;\n}) => {\n const { authorization, host, project, repo } = opts;\n\n const options: RequestInit = {\n method: 'PUT',\n headers: {\n Authorization: authorization,\n },\n };\n\n const { ok, status, statusText } = await fetch(\n `https://${host}/rest/git-lfs/admin/projects/${project}/repos/${repo}/enabled`,\n options,\n );\n\n if (!ok)\n throw new Error(\n `Failed to enable LFS in the repository, ${status}: ${statusText}`,\n );\n};\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to Bitbucket.\n * @public\n * @deprecated in favor of \"createPublishBitbucketCloudAction\" by \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud and \"createPublishBitbucketServerAction\" by \\@backstage/plugin-scaffolder-backend-module-bitbucket-server\n */\nexport function createPublishBitbucketAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction({\n id: 'publish:bitbucket',\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Bitbucket.',\n examples,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description: 'Repository Location',\n }),\n description: z =>\n z\n .string({\n description: 'Repository Description',\n })\n .optional(),\n repoVisibility: z =>\n z\n .enum(['private', 'public'], {\n description: 'Repository Visibility',\n })\n .optional(),\n defaultBranch: z =>\n z\n .string({\n description: `Sets the default branch on the repository. The default value is 'master'`,\n })\n .optional(),\n sourcePath: z =>\n z\n .string({\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.',\n })\n .optional(),\n enableLFS: z =>\n z\n .boolean({\n description:\n 'Enable LFS for the repository. Only available for hosted Bitbucket.',\n })\n .optional(),\n token: z =>\n z\n .string({\n description: 'The token to use for authorization to BitBucket',\n })\n .optional(),\n gitCommitMessage: z =>\n z\n .string({\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n })\n .optional(),\n gitAuthorName: z =>\n z\n .string({\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n })\n .optional(),\n gitAuthorEmail: z =>\n z\n .string({\n description: `Sets the default author email for the commit.`,\n })\n .optional(),\n signCommit: z =>\n z\n .boolean({\n description: 'Sign commit with configured PGP private key',\n })\n .optional(),\n },\n output: {\n remoteUrl: z =>\n z\n .string({\n description: 'A URL to the repository with the provider',\n })\n .optional(),\n repoContentsUrl: z =>\n z\n .string({\n description: 'A URL to the root of the repository',\n })\n .optional(),\n commitHash: z =>\n z\n .string({\n description: 'The git commit hash of the initial commit',\n })\n .optional(),\n },\n },\n async handler(ctx) {\n ctx.logger.warn(\n `[Deprecated] Please migrate the use of action \"publish:bitbucket\" to \"publish:bitbucketCloud\" or \"publish:bitbucketServer\".`,\n );\n const {\n repoUrl,\n description,\n defaultBranch = 'master',\n repoVisibility = 'private',\n enableLFS = false,\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n signCommit,\n } = ctx.input;\n\n const { workspace, project, repo, host } = parseRepoUrl(\n repoUrl,\n integrations,\n );\n\n // Workspace is only required for bitbucket cloud\n if (host === 'bitbucket.org') {\n if (!workspace) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing workspace`,\n );\n }\n }\n\n // Project is required for both bitbucket cloud and bitbucket server\n if (!project) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing project`,\n );\n }\n\n const integrationConfig = integrations.bitbucket.byHost(host);\n\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n const authorization = getAuthorizationHeader(\n ctx.input.token\n ? {\n host: integrationConfig.config.host,\n apiBaseUrl: integrationConfig.config.apiBaseUrl,\n token: ctx.input.token,\n }\n : integrationConfig.config,\n );\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const createMethod =\n host === 'bitbucket.org'\n ? createBitbucketCloudRepository\n : createBitbucketServerRepository;\n\n const { remoteUrl, repoContentsUrl } = await ctx.checkpoint({\n key: `create.repo.${host}.${repo}`,\n fn: async () =>\n createMethod({\n authorization,\n workspace: workspace || '',\n project,\n repo,\n repoVisibility,\n mainBranch: defaultBranch,\n description,\n apiBaseUrl,\n }),\n });\n\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n const signingKey =\n integrationConfig.config.commitSigningKey ??\n config.getOptionalString('scaffolder.defaultCommitSigningKey');\n if (signCommit && !signingKey) {\n throw new Error(\n 'Signing commits is enabled but no signing key is provided in the configuration',\n );\n }\n\n let auth;\n\n if (ctx.input.token) {\n auth = {\n username: 'x-token-auth',\n password: ctx.input.token,\n };\n } else {\n auth = {\n username: integrationConfig.config.username\n ? integrationConfig.config.username\n : 'x-token-auth',\n password: integrationConfig.config.appPassword\n ? integrationConfig.config.appPassword\n : integrationConfig.config.token ?? '',\n };\n }\n\n const commitHash = await ctx.checkpoint({\n key: `init.repo.and.push${host}.${repo}`,\n fn: async () => {\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(\n ctx.workspacePath,\n ctx.input.sourcePath,\n ),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage'),\n gitAuthorInfo,\n signingKey: signCommit ? signingKey : undefined,\n });\n return commitResult?.commitHash;\n },\n });\n\n if (enableLFS && host !== 'bitbucket.org') {\n await performEnableLFS({ authorization, host, project, repo });\n }\n\n ctx.output('commitHash', commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n"],"names":["createTemplateAction","examples","parseRepoUrl","InputError","initRepoAndPush","getRepoSourceDirectory"],"mappings":";;;;;;AA8BA,MAAM,8BAAA,GAAiC,OAAO,IASxC,KAAA;AACJ,EAAM,MAAA;AAAA,IACJ,SAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,GACE,GAAA,IAAA;AAEJ,EAAA,MAAM,OAAuB,GAAA;AAAA,IAC3B,MAAQ,EAAA,MAAA;AAAA,IACR,IAAA,EAAM,KAAK,SAAU,CAAA;AAAA,MACnB,GAAK,EAAA,KAAA;AAAA,MACL,WAAA;AAAA,MACA,YAAY,cAAmB,KAAA,SAAA;AAAA,MAC/B,OAAA,EAAS,EAAE,GAAA,EAAK,OAAQ;AAAA,KACzB,CAAA;AAAA,IACD,OAAS,EAAA;AAAA,MACP,aAAe,EAAA,aAAA;AAAA,MACf,cAAgB,EAAA;AAAA;AAClB,GACF;AAEA,EAAI,IAAA,QAAA;AACJ,EAAI,IAAA;AACF,IAAA,QAAA,GAAW,MAAM,KAAA;AAAA,MACf,CAAG,EAAA,UAAU,CAAiB,cAAA,EAAA,SAAS,IAAI,IAAI,CAAA,CAAA;AA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D,CAAA;AAED,MAAI,IAAA,SAAA,IAAa,SAAS,eAAiB,EAAA;AACzC,QAAA,MAAM,iBAAiB,EAAE,aAAA,EAAe,IAAM,EAAA,OAAA,EAAS,MAAM,CAAA;AAAA;AAG/D,MAAI,GAAA,CAAA,MAAA,CAAO,cAAc,UAAU,CAAA;AACnC,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AACjC,MAAI,GAAA,CAAA,MAAA,CAAO,mBAAmB,eAAe,CAAA;AAAA;AAC/C,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"bitbucket.cjs.js","sources":["../../src/actions/bitbucket.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 { InputError } from '@backstage/errors';\nimport {\n BitbucketIntegrationConfig,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n getRepoSourceDirectory,\n initRepoAndPush,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { Config } from '@backstage/config';\nimport { examples } from './bitbucket.examples';\n\nconst createBitbucketCloudRepository = async (opts: {\n workspace: string;\n project: string;\n repo: string;\n description?: string;\n repoVisibility: 'private' | 'public';\n mainBranch: string;\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n workspace,\n project,\n repo,\n description,\n repoVisibility,\n mainBranch,\n authorization,\n apiBaseUrl,\n } = opts;\n\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n scm: 'git',\n description: description,\n is_private: repoVisibility === 'private',\n project: { key: project },\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n let response: Response;\n try {\n response = await fetch(\n `${apiBaseUrl}/repositories/${workspace}/${repo}`,\n options,\n );\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n\n if (response.status !== 200) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n let remoteUrl = '';\n for (const link of r.links.clone) {\n if (link.name === 'https') {\n remoteUrl = link.href;\n }\n }\n\n // \"mainbranch.name\" cannot be set neither at create nor update of the repo\n // the first pushed branch will be set as \"main branch\" then\n const repoContentsUrl = `${r.links.html.href}/src/${mainBranch}`;\n return { remoteUrl, repoContentsUrl };\n};\n\nconst createBitbucketServerRepository = async (opts: {\n project: string;\n repo: string;\n description?: string;\n repoVisibility: 'private' | 'public';\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n project,\n repo,\n description,\n authorization,\n repoVisibility,\n apiBaseUrl,\n } = opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: repo,\n description: description,\n public: repoVisibility === 'public',\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(`${apiBaseUrl}/projects/${project}/repos`, options);\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n let remoteUrl = '';\n for (const link of r.links.clone) {\n if (link.name === 'http') {\n remoteUrl = link.href;\n }\n }\n\n const repoContentsUrl = `${r.links.self[0].href}`;\n return { remoteUrl, repoContentsUrl };\n};\n\nconst getAuthorizationHeader = (config: BitbucketIntegrationConfig) => {\n if (config.username && config.appPassword) {\n const buffer = Buffer.from(\n `${config.username}:${config.appPassword}`,\n 'utf8',\n );\n\n return `Basic ${buffer.toString('base64')}`;\n }\n\n if (config.token) {\n return `Bearer ${config.token}`;\n }\n\n throw new Error(\n `Authorization has not been provided for Bitbucket. Please add either username + appPassword or token to the Integrations config`,\n );\n};\n\nconst performEnableLFS = async (opts: {\n authorization: string;\n host: string;\n project: string;\n repo: string;\n}) => {\n const { authorization, host, project, repo } = opts;\n\n const options: RequestInit = {\n method: 'PUT',\n headers: {\n Authorization: authorization,\n },\n };\n\n const { ok, status, statusText } = await fetch(\n `https://${host}/rest/git-lfs/admin/projects/${project}/repos/${repo}/enabled`,\n options,\n );\n\n if (!ok)\n throw new Error(\n `Failed to enable LFS in the repository, ${status}: ${statusText}`,\n );\n};\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to Bitbucket.\n * @public\n * @deprecated in favor of \"createPublishBitbucketCloudAction\" by \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud and \"createPublishBitbucketServerAction\" by \\@backstage/plugin-scaffolder-backend-module-bitbucket-server\n */\nexport function createPublishBitbucketAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction({\n id: 'publish:bitbucket',\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Bitbucket.',\n examples,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description: 'Repository Location',\n }),\n description: z =>\n z\n .string({\n description: 'Repository Description',\n })\n .optional(),\n repoVisibility: z =>\n z\n .enum(['private', 'public'], {\n description: 'Repository Visibility',\n })\n .optional(),\n defaultBranch: z =>\n z\n .string({\n description: `Sets the default branch on the repository. The default value is 'master'`,\n })\n .optional(),\n sourcePath: z =>\n z\n .string({\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.',\n })\n .optional(),\n enableLFS: z =>\n z\n .boolean({\n description:\n 'Enable LFS for the repository. Only available for hosted Bitbucket.',\n })\n .optional(),\n token: z =>\n z\n .string({\n description: 'The token to use for authorization to BitBucket',\n })\n .optional(),\n gitCommitMessage: z =>\n z\n .string({\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n })\n .optional(),\n gitAuthorName: z =>\n z\n .string({\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n })\n .optional(),\n gitAuthorEmail: z =>\n z\n .string({\n description: `Sets the default author email for the commit.`,\n })\n .optional(),\n signCommit: z =>\n z\n .boolean({\n description: 'Sign commit with configured PGP private key',\n })\n .optional(),\n },\n output: {\n remoteUrl: z =>\n z\n .string({\n description: 'A URL to the repository with the provider',\n })\n .optional(),\n repoContentsUrl: z =>\n z\n .string({\n description: 'A URL to the root of the repository',\n })\n .optional(),\n commitHash: z =>\n z\n .string({\n description: 'The git commit hash of the initial commit',\n })\n .optional(),\n },\n },\n async handler(ctx) {\n ctx.logger.warn(\n `[Deprecated] Please migrate the use of action \"publish:bitbucket\" to \"publish:bitbucketCloud\" or \"publish:bitbucketServer\".`,\n );\n const {\n repoUrl,\n description,\n defaultBranch = 'master',\n repoVisibility = 'private',\n enableLFS = false,\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n signCommit,\n } = ctx.input;\n\n const { workspace, project, repo, host } = parseRepoUrl(\n repoUrl,\n integrations,\n );\n\n // Workspace is only required for bitbucket cloud\n if (host === 'bitbucket.org') {\n if (!workspace) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing workspace`,\n );\n }\n }\n\n // Project is required for both bitbucket cloud and bitbucket server\n if (!project) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing project`,\n );\n }\n\n const integrationConfig = integrations.bitbucket.byHost(host);\n\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n const authorization = getAuthorizationHeader(\n ctx.input.token\n ? {\n host: integrationConfig.config.host,\n apiBaseUrl: integrationConfig.config.apiBaseUrl,\n token: ctx.input.token,\n }\n : integrationConfig.config,\n );\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const createMethod =\n host === 'bitbucket.org'\n ? createBitbucketCloudRepository\n : createBitbucketServerRepository;\n\n const { remoteUrl, repoContentsUrl } = await ctx.checkpoint({\n key: `create.repo.${host}.${repo}`,\n fn: async () =>\n createMethod({\n authorization,\n workspace: workspace || '',\n project,\n repo,\n repoVisibility,\n mainBranch: defaultBranch,\n description,\n apiBaseUrl,\n }),\n });\n\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n const signingKey =\n integrationConfig.config.commitSigningKey ??\n config.getOptionalString('scaffolder.defaultCommitSigningKey');\n if (signCommit && !signingKey) {\n throw new Error(\n 'Signing commits is enabled but no signing key is provided in the configuration',\n );\n }\n\n let auth;\n\n if (ctx.input.token) {\n auth = {\n username: 'x-token-auth',\n password: ctx.input.token,\n };\n } else {\n auth = {\n username: integrationConfig.config.username\n ? integrationConfig.config.username\n : 'x-token-auth',\n password: integrationConfig.config.appPassword\n ? integrationConfig.config.appPassword\n : integrationConfig.config.token ?? '',\n };\n }\n\n const commitHash = await ctx.checkpoint({\n key: `init.repo.and.push${host}.${repo}`,\n fn: async () => {\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(\n ctx.workspacePath,\n ctx.input.sourcePath,\n ),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage'),\n gitAuthorInfo,\n signingKey: signCommit ? signingKey : undefined,\n });\n return commitResult?.commitHash;\n },\n });\n\n if (enableLFS && host !== 'bitbucket.org') {\n await performEnableLFS({ authorization, host, project, repo });\n }\n\n ctx.output('commitHash', commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n"],"names":["createTemplateAction","examples","parseRepoU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@@ -1 +1 @@
1
- {"version":3,"file":"bitbucket.examples.cjs.js","sources":["../../src/actions/bitbucket.examples.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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Initializes a git repository with the content in the workspace, and publishes it to Bitbucket with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n description: 'Initialize a git repository',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with public repo visibility, if not set defaults to private',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n repoVisibility: 'public',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with a default branch, if not set defaults to master',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n defaultBranch: 'main',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n sourcePath: './repoRoot',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket repository with LFS enabled',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n enableLFS: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with a custom authentication token',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n token: 'your-auth-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with an initial commit message, if not set defaults to `initial commit`',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n gitCommitMessage: 'Initial commit with custom message',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket repository with a custom author',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n gitAuthorName: 'Your Name',\n gitAuthorEmail: 'your.email@example.com',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with all properties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n description: 'Initialize a git repository',\n repoVisibility: 'public',\n defaultBranch: 'main',\n token: 'your-auth-token',\n gitCommitMessage: 'Initial commit with custom message',\n gitAuthorName: 'Your Name',\n gitAuthorEmail: 'your.email@example.com',\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAmBO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WACE,EAAA,+HAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,mBAAA;AAAA,UACR,IAAM,EAAA,sBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OACE,EAAA;AAAA;AACJ;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,wDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,mBAAA;AAAA,UACR,IAAM,EAAA,sBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OACE,EAAA,6DAAA;AAAA,YACF,WAAa,EAAA;AAAA;AACf;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WACE,EAAA,gGAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,mBAAA;AAAA,UACR,IAAM,EAAA,sBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OACE,EAAA,6DAAA;AAAA,YACF,cAAgB,EAAA;AAAA;AAClB;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WACE,EAAA,yF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","sources":["../../src/actions/bitbucket.examples.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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Initializes a git repository with the content in the workspace, and publishes it to Bitbucket with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n description: 'Initialize a git repository',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with public repo visibility, if not set defaults to private',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n repoVisibility: 'public',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with a default branch, if not set defaults to master',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n defaultBranch: 'main',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n sourcePath: './repoRoot',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket repository with LFS enabled',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n enableLFS: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with a custom authentication token',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n token: 'your-auth-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with an initial commit message, if not set defaults to `initial commit`',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n gitCommitMessage: 'Initial commit with custom message',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket repository with a custom author',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n gitAuthorName: 'Your Name',\n gitAuthorEmail: 'your.email@example.com',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket repository with all properties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucket',\n name: 'Publish to Bitbucket',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n description: 'Initialize a git repository',\n repoVisibility: 'public',\n defaultBranch: 'main',\n token: 'your-auth-token',\n gitCommitMessage: 'Initial commit with custom message',\n gitAuthorName: 'Your Name',\n gitAuthorEmail: 'your.email@example.com',\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAmBO,MAAM,QAAA,GAA8B;AAAA,EACzC;AAAA,IACE,WAAA,EACE,+HAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,EAAA,EAAI,SAAA;AAAA,UACJ,MAAA,EAAQ,mBAAA;AAAA,UACR,IAAA,EAAM,sBAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EACE;AAAA;AACJ;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,wDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,EAAA,EAAI,SAAA;AAAA,UACJ,MAAA,EAAQ,mBAAA;AAAA,UACR,IAAA,EAAM,sBAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EACE,6DAAA;AAAA,YACF,WAAA,EAAa;AAAA;AACf;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EACE,gGAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,EAAA,EAAI,SAAA;AAAA,UACJ,MAAA,EAAQ,mBAAA;AAAA,UACR,IAAA,EAAM,sBAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EACE,6DAAA;AAAA,YACF,cAAA,EAAgB;AAAA;AAClB;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EACE,yFAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAA,CAAU;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copyright 2024 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 */\nimport * as bitbucketCloud from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud';\nimport * as bitbucketServer from '@backstage/plugin-scaffolder-backend-module-bitbucket-server';\n\nexport { createPublishBitbucketAction } from './actions/bitbucket';\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-cloud` instead\n */\nexport const createPublishBitbucketCloudAction =\n bitbucketCloud.createPublishBitbucketCloudAction;\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-cloud` instead\n */\nexport const createBitbucketPipelinesRunAction =\n bitbucketCloud.createBitbucketPipelinesRunAction;\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-server` instead\n */\nexport const createPublishBitbucketServerAction =\n bitbucketServer.createPublishBitbucketServerAction;\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-server` instead\n */\nexport const createPublishBitbucketServerPullRequestAction =\n bitbucketServer.createPublishBitbucketServerPullRequestAction;\n"],"names":["bitbucketCloud","bitbucketServer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,oCACXA,yBAAe,CAAA;AAMV,MAAM,oCACXA,yBAAe,CAAA;AAMV,MAAM,qCACXC,0BAAgB,CAAA;AAMX,MAAM,gDACXA,0BAAgB,CAAA;;;;;;;"}
1
+ {"version":3,"file":"deprecated.cjs.js","sources":["../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport * as bitbucketCloud from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud';\nimport * as bitbucketServer from '@backstage/plugin-scaffolder-backend-module-bitbucket-server';\n\nexport { createPublishBitbucketAction } from './actions/bitbucket';\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-cloud` instead\n */\nexport const createPublishBitbucketCloudAction =\n bitbucketCloud.createPublishBitbucketCloudAction;\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-cloud` instead\n */\nexport const createBitbucketPipelinesRunAction =\n bitbucketCloud.createBitbucketPipelinesRunAction;\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-server` instead\n */\nexport const createPublishBitbucketServerAction =\n bitbucketServer.createPublishBitbucketServerAction;\n\n/**\n * @public\n * @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-server` instead\n */\nexport const createPublishBitbucketServerPullRequestAction =\n bitbucketServer.createPublishBitbucketServerPullRequestAction;\n"],"names":["bitbucketCloud","bitbucketServer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAM,oCACXA,yBAAA,CAAe;AAMV,MAAM,oCACXA,yBAAA,CAAe;AAMV,MAAM,qCACXC,0BAAA,CAAgB;AAMX,MAAM,gDACXA,0BAAA,CAAgB;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createBitbucketPipelinesRunAction,\n createPublishBitbucketCloudAction,\n createPublishBitbucketServerAction,\n createPublishBitbucketServerPullRequestAction,\n} from './deprecated';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * The Bitbucket Module for the Scaffolder Backend\n * @public\n * @deprecated use module by \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud or \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const bitbucketModule = createBackendModule({\n moduleId: 'bitbucket',\n pluginId: 'scaffolder',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n scaffolder.addActions(\n createPublishBitbucketCloudAction({ integrations, config }),\n createPublishBitbucketServerAction({ integrations, config }),\n createPublishBitbucketServerPullRequestAction({\n integrations,\n config,\n }),\n createBitbucketPipelinesRunAction({ integrations }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations","createPublishBitbucketCloudAction","createPublishBitbucketServerAction","createPublishBitbucketServerPullRequestAction","createBitbucketPipelinesRunAction"],"mappings":";;;;;;;AAiCO,MAAM,kBAAkBA,oCAAoB,CAAA;AAAA,EACjD,QAAU,EAAA,WAAA;AAAA,EACV,QAAU,EAAA,YAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAgB,EAAA;AACzB,IAAa,YAAA,CAAA;AAAA,MACX,IAAM,EAAA;AAAA,QACJ,UAAY,EAAAC,qCAAA;AAAA,QACZ,QAAQC,6BAAa,CAAA;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAA,EAAY,QAAU,EAAA;AACjC,QAAM,MAAA,YAAA,GAAeC,2BAAgB,CAAA,UAAA,CAAW,MAAM,CAAA;AAEtD,QAAW,UAAA,CAAA,UAAA;AAAA,UACTC,4CAAkC,CAAA,EAAE,YAAc,EAAA,MAAA,EAAQ,CAAA;AAAA,UAC1DC,6CAAmC,CAAA,EAAE,YAAc,EAAA,MAAA,EAAQ,CAAA;AAAA,UAC3DC,wDAA8C,CAAA;AAAA,YAC5C,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,4CAAA,CAAkC,EAAE,YAAA,EAAc;AAAA,SACpD;AAAA;AACF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createBitbucketPipelinesRunAction,\n createPublishBitbucketCloudAction,\n createPublishBitbucketServerAction,\n createPublishBitbucketServerPullRequestAction,\n} from './deprecated';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * The Bitbucket Module for the Scaffolder Backend\n * @public\n * @deprecated use module by \\@backstage/plugin-scaffolder-backend-module-bitbucket-cloud or \\@backstage/plugin-scaffolder-backend-module-bitbucket-server instead\n */\nexport const bitbucketModule = createBackendModule({\n moduleId: 'bitbucket',\n pluginId: 'scaffolder',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n scaffolder.addActions(\n createPublishBitbucketCloudAction({ integrations, config }),\n createPublishBitbucketServerAction({ integrations, config }),\n createPublishBitbucketServerPullRequestAction({\n integrations,\n config,\n }),\n createBitbucketPipelinesRunAction({ integrations }),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations","createPublishBitbucketCloudAction","createPublishBitbucketServerAction","createPublishBitbucketServerPullRequestAction","createBitbucketPipelinesRunAction"],"mappings":";;;;;;;AAiCO,MAAM,kBAAkBA,oCAAA,CAAoB;AAAA,EACjD,QAAA,EAAU,WAAA;AAAA,EACV,QAAA,EAAU,YAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAa,EAAG;AACzB,IAAA,YAAA,CAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,UAAA,EAAYC,qCAAA;AAAA,QACZ,QAAQC,6BAAA,CAAa;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAA,EAAY,QAAO,EAAG;AACjC,QAAA,MAAM,YAAA,GAAeC,2BAAA,CAAgB,UAAA,CAAW,MAAM,CAAA;AAEtD,QAAA,UAAA,CAAW,UAAA;AAAA,UACTC,4CAAA,CAAkC,EAAE,YAAA,EAAc,MAAA,EAAQ,CAAA;AAAA,UAC1DC,6CAAA,CAAmC,EAAE,YAAA,EAAc,MAAA,EAAQ,CAAA;AAAA,UAC3DC,wDAAA,CAA8C;AAAA,YAC5C,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,4CAAA,CAAkC,EAAE,YAAA,EAAc;AAAA,SACpD;AAAA,MACF;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-bitbucket",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "The bitbucket module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -50,20 +50,20 @@
50
50
  "test": "backstage-cli package test"
51
51
  },
52
52
  "dependencies": {
53
- "@backstage/backend-plugin-api": "^1.4.1",
53
+ "@backstage/backend-plugin-api": "^1.4.2",
54
54
  "@backstage/config": "^1.3.3",
55
55
  "@backstage/errors": "^1.2.7",
56
56
  "@backstage/integration": "^1.17.1",
57
- "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "^0.2.11",
58
- "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "^0.2.11",
59
- "@backstage/plugin-scaffolder-node": "^0.10.0",
57
+ "@backstage/plugin-scaffolder-backend-module-bitbucket-cloud": "^0.2.12",
58
+ "@backstage/plugin-scaffolder-backend-module-bitbucket-server": "^0.2.12",
59
+ "@backstage/plugin-scaffolder-node": "^0.11.0",
60
60
  "fs-extra": "^11.2.0",
61
61
  "yaml": "^2.0.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@backstage/backend-test-utils": "^1.7.0",
65
- "@backstage/cli": "^0.33.1",
66
- "@backstage/plugin-scaffolder-node-test-utils": "^0.3.1",
64
+ "@backstage/backend-test-utils": "^1.8.0",
65
+ "@backstage/cli": "^0.34.0",
66
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.3.2",
67
67
  "msw": "^1.0.0"
68
68
  },
69
69
  "deprecated": true