@backstage/plugin-scaffolder-backend-module-bitbucket-cloud 0.1.11 → 0.1.12-next.1

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,26 +1,29 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-bitbucket-cloud
2
2
 
3
- ## 0.1.11
3
+ ## 0.1.12-next.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @backstage/backend-plugin-api@0.6.21
9
- - @backstage/plugin-scaffolder-node@0.4.7
8
+ - @backstage/backend-plugin-api@0.6.22-next.1
10
9
  - @backstage/config@1.2.0
11
10
  - @backstage/errors@1.2.4
12
- - @backstage/integration@1.12.0
11
+ - @backstage/integration@1.13.0-next.0
12
+ - @backstage/plugin-bitbucket-cloud-common@0.2.21-next.0
13
+ - @backstage/plugin-scaffolder-node@0.4.8-next.1
13
14
 
14
- ## 0.1.10
15
+ ## 0.1.11-next.0
15
16
 
16
17
  ### Patch Changes
17
18
 
19
+ - b5deed0: Add support for `autocomplete` handler to provide autocomplete options for `RepoUrlPicker`
18
20
  - Updated dependencies
19
- - @backstage/plugin-scaffolder-node@0.4.6
20
- - @backstage/backend-plugin-api@0.6.20
21
+ - @backstage/backend-plugin-api@0.6.21-next.0
22
+ - @backstage/integration@1.13.0-next.0
23
+ - @backstage/plugin-scaffolder-node@0.4.7-next.0
24
+ - @backstage/plugin-bitbucket-cloud-common@0.2.21-next.0
21
25
  - @backstage/config@1.2.0
22
26
  - @backstage/errors@1.2.4
23
- - @backstage/integration@1.12.0
24
27
 
25
28
  ## 0.1.9
26
29
 
package/dist/index.cjs.js CHANGED
@@ -9,6 +9,7 @@ var yaml = require('yaml');
9
9
  var backendPluginApi = require('@backstage/backend-plugin-api');
10
10
  var alpha = require('@backstage/plugin-scaffolder-node/alpha');
11
11
  var integration = require('@backstage/integration');
12
+ var pluginBitbucketCloudCommon = require('@backstage/plugin-bitbucket-cloud-common');
12
13
 
13
14
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
15
 
@@ -719,6 +720,54 @@ const createBitbucketPipelinesRunAction = (options) => {
719
720
  });
720
721
  };
721
722
 
723
+ async function handleAutocompleteRequest({
724
+ resource,
725
+ token,
726
+ context
727
+ }) {
728
+ const client = pluginBitbucketCloudCommon.BitbucketCloudClient.fromConfig({
729
+ host: "bitbucket.org",
730
+ apiBaseUrl: "https://api.bitbucket.org/2.0",
731
+ token
732
+ });
733
+ switch (resource) {
734
+ case "workspaces": {
735
+ const result = [];
736
+ for await (const page of client.listWorkspaces().iteratePages()) {
737
+ const slugs = [...page.values].map((p) => p.slug);
738
+ result.push(...slugs);
739
+ }
740
+ return { results: result.map((title) => ({ title })) };
741
+ }
742
+ case "projects": {
743
+ if (!context.workspace)
744
+ throw new errors.InputError("Missing workspace context parameter");
745
+ const result = [];
746
+ for await (const page of client.listProjectsByWorkspace(context.workspace).iteratePages()) {
747
+ const keys = [...page.values].map((p) => p.key);
748
+ result.push(...keys);
749
+ }
750
+ return { results: result.map((title) => ({ title })) };
751
+ }
752
+ case "repositories": {
753
+ if (!context.workspace || !context.project)
754
+ throw new errors.InputError(
755
+ "Missing workspace and/or project context parameter"
756
+ );
757
+ const result = [];
758
+ for await (const page of client.listRepositoriesByWorkspace(context.workspace, {
759
+ q: `project.key="${context.project}"`
760
+ }).iteratePages()) {
761
+ const slugs = [...page.values].map((p) => p.slug);
762
+ result.push(...slugs);
763
+ }
764
+ return { results: result.map((title) => ({ title })) };
765
+ }
766
+ default:
767
+ throw new errors.InputError(`Invalid resource: ${resource}`);
768
+ }
769
+ }
770
+
722
771
  const bitbucketCloudModule = backendPluginApi.createBackendModule({
723
772
  moduleId: "bitbucketCloud",
724
773
  pluginId: "scaffolder",
@@ -726,14 +775,19 @@ const bitbucketCloudModule = backendPluginApi.createBackendModule({
726
775
  registerInit({
727
776
  deps: {
728
777
  scaffolder: alpha.scaffolderActionsExtensionPoint,
778
+ autocomplete: alpha.scaffolderAutocompleteExtensionPoint,
729
779
  config: backendPluginApi.coreServices.rootConfig
730
780
  },
731
- async init({ scaffolder, config }) {
781
+ async init({ scaffolder, config, autocomplete }) {
732
782
  const integrations = integration.ScmIntegrations.fromConfig(config);
733
783
  scaffolder.addActions(
734
784
  createPublishBitbucketCloudAction({ integrations, config }),
735
785
  createBitbucketPipelinesRunAction({ integrations })
736
786
  );
787
+ autocomplete.addAutocompleteProvider({
788
+ id: "bitbucket-cloud",
789
+ handler: handleAutocompleteRequest
790
+ });
737
791
  }
738
792
  });
739
793
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/actions/helpers.ts","../src/actions/bitbucketCloud.examples.ts","../src/actions/bitbucketCloud.ts","../src/actions/bitbucketCloudPipelinesRun.examples.ts","../src/actions/inputProperties.ts","../src/actions/bitbucketCloudPipelinesRun.ts","../src/module.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\nexport const getAuthorizationHeader = (config: {\n username?: string;\n appPassword?: string;\n token?: string;\n}) => {\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 Cloud. Please add either username + appPassword to the Integrations config or a user login auth token`,\n );\n};\n","/*\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 Cloud with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket Cloud repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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 Cloud repository with public repo visibility, if not set defaults to private',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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 Cloud repository with a default Branch, if not set defaults to master',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n sourcePath: './repoRoot',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket Cloud repository with a custom authentication token',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n token: 'your-custom-auth-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket Cloud repository with all proporties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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-custom-auth-token',\n },\n },\n ],\n }),\n },\n];\n","/*\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport {\n createTemplateAction,\n initRepoAndPush,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport fetch, { Response, RequestInit } from 'node-fetch';\n\nimport { Config } from '@backstage/config';\nimport { getAuthorizationHeader } from './helpers';\nimport { examples } from './bitbucketCloud.examples';\n\nconst createRepository = 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\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to Bitbucket Cloud.\n * @public\n */\nexport function createPublishBitbucketCloudAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n defaultBranch?: string;\n repoVisibility?: 'private' | 'public';\n sourcePath?: string;\n token?: string;\n }>({\n id: 'publish:bitbucketCloud',\n examples,\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Bitbucket Cloud.',\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n description: {\n title: 'Repository Description',\n type: 'string',\n },\n repoVisibility: {\n title: 'Repository Visibility',\n type: 'string',\n enum: ['private', 'public'],\n },\n defaultBranch: {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\n },\n sourcePath: {\n title: 'Source Path',\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 type: 'string',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description:\n 'The token to use for authorization to BitBucket Cloud',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: {\n title: 'A URL to the repository with the provider',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the root of the repository',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the initial commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n defaultBranch = 'master',\n repoVisibility = 'private',\n } = ctx.input;\n\n const { workspace, project, repo, host } = parseRepoUrl(\n repoUrl,\n integrations,\n );\n\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 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.bitbucketCloud.byHost(host);\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 ? { token: ctx.input.token } : integrationConfig.config,\n );\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const { remoteUrl, repoContentsUrl } = await createRepository({\n authorization,\n workspace: workspace || '',\n project,\n repo,\n repoVisibility,\n mainBranch: defaultBranch,\n description,\n apiBaseUrl,\n });\n\n const gitAuthorInfo = {\n name: config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: config.getOptionalString('scaffolder.defaultAuthor.email'),\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 if (\n !integrationConfig.config.username ||\n !integrationConfig.config.appPassword\n ) {\n throw new Error(\n 'Credentials for Bitbucket Cloud integration required for this action.',\n );\n }\n\n auth = {\n username: integrationConfig.config.username,\n password: integrationConfig.config.appPassword,\n };\n }\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: config.getOptionalString(\n 'scaffolder.defaultCommitMessage',\n ),\n gitAuthorInfo,\n });\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n","/*\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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Trigger a pipeline for a branch',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n ref_type: 'branch',\n type: 'pipeline_ref_target',\n ref_name: 'master',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a pipeline for a commit on a branch',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n commit: {\n type: 'commit',\n hash: 'ce5b7431602f7cbba007062eeb55225c6e18e956',\n },\n ref_type: 'branch',\n type: 'pipeline_ref_target',\n ref_name: 'master',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a specific pipeline definition for a commit',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n commit: {\n type: 'commit',\n hash: 'a3c4e02c9a3755eccdc3764e6ea13facdf30f923',\n },\n selector: {\n type: 'custom',\n pattern: 'Deploy to production',\n },\n type: 'pipeline_commit_target',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description:\n 'Trigger a specific pipeline definition for a commit on a branch or tag',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n commit: {\n type: 'commit',\n hash: 'a3c4e02c9a3755eccdc3764e6ea13facdf30f923',\n },\n selector: {\n type: 'custom',\n pattern: 'Deploy to production',\n },\n type: 'pipeline_ref_target',\n ref_name: 'master',\n ref_type: 'branch',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a custom pipeline with variables',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n type: 'pipeline_ref_target',\n ref_name: 'master',\n ref_type: 'branch',\n selector: {\n type: 'custom',\n pattern: 'Deploy to production',\n },\n },\n variables: [\n { key: 'var1key', value: 'var1value', secured: true },\n {\n key: 'var2key',\n value: 'var2value',\n },\n ],\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a pull request pipeline',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n type: 'pipeline_pullrequest_target',\n source: 'pull-request-branch',\n destination: 'master',\n destination_commit: {\n hash: '9f848b7',\n },\n commit: {\n hash: '1a372fc',\n },\n pull_request: {\n id: '3',\n },\n selector: {\n type: 'pull-requests',\n pattern: '**',\n },\n },\n },\n },\n },\n ],\n }),\n },\n];\n","/*\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\nconst workspace = {\n title: 'Workspace',\n description: `The workspace name`,\n type: 'string',\n};\n\nconst repo_slug = {\n title: 'Repository name',\n description: 'The repository name',\n type: 'string',\n};\n\nconst ref_type = {\n title: 'ref_type',\n type: 'string',\n};\n\nconst type = {\n title: 'type',\n type: 'string',\n};\n\nconst ref_name = {\n title: 'ref_name',\n type: 'string',\n};\nconst source = {\n title: 'source',\n type: 'string',\n};\nconst destination = {\n title: 'destination',\n type: 'string',\n};\nconst hash = {\n title: 'hash',\n type: 'string',\n};\n\nconst pattern = {\n title: 'pattern',\n type: 'string',\n};\n\nconst id = {\n title: 'id',\n type: 'string',\n};\n\nconst key = {\n title: 'key',\n type: 'string',\n};\nconst value = {\n title: 'value',\n type: 'string',\n};\nconst secured = {\n title: 'secured',\n type: 'boolean',\n};\n\nconst token = {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to BitBucket Cloud',\n};\n\nconst destination_commit = {\n title: 'destination_commit',\n type: 'object',\n properties: {\n hash,\n },\n};\n\nconst commit = {\n title: 'commit',\n type: 'object',\n properties: {\n type,\n hash,\n },\n};\n\nconst selector = {\n title: 'selector',\n type: 'object',\n properties: {\n type,\n pattern,\n },\n};\n\nconst pull_request = {\n title: 'pull_request',\n type: 'object',\n properties: {\n id,\n },\n};\n\nconst pipelinesRunBody = {\n title: 'Request Body',\n description:\n 'Request body properties: see Bitbucket Cloud Rest API documentation for more details',\n type: 'object',\n properties: {\n target: {\n title: 'target',\n type: 'object',\n properties: {\n ref_type,\n type,\n ref_name,\n source,\n destination,\n destination_commit,\n commit,\n selector,\n pull_request,\n },\n },\n variables: {\n title: 'variables',\n type: 'array',\n items: {\n type: 'object',\n properties: {\n key,\n value,\n secured,\n },\n },\n },\n },\n};\n\nexport { workspace, repo_slug, pipelinesRunBody, token };\n","/*\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 { examples } from './bitbucketCloudPipelinesRun.examples';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport fetch, { Response } from 'node-fetch';\nimport * as inputProps from './inputProperties';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { getAuthorizationHeader } from './helpers';\n\nconst id = 'bitbucket:pipelines:run';\n/**\n * Creates a new action that triggers a run of a bitbucket pipeline\n *\n * @public\n */\nexport const createBitbucketPipelinesRunAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction<{\n workspace: string;\n repo_slug: string;\n body?: object;\n token?: string;\n }>({\n id,\n description: 'Run a bitbucket cloud pipeline',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['workspace', 'repo_slug'],\n properties: {\n workspace: inputProps.workspace,\n repo_slug: inputProps.repo_slug,\n body: inputProps.pipelinesRunBody,\n token: inputProps.token,\n },\n },\n output: {\n type: 'object',\n properties: {\n buildNumber: {\n title: 'Build number',\n type: 'number',\n },\n repoUrl: {\n title: 'A URL to the pipeline repositry',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the pipeline',\n type: 'string',\n },\n },\n },\n },\n supportsDryRun: false,\n async handler(ctx) {\n const { workspace, repo_slug, body, token } = ctx.input;\n const host = 'bitbucket.org';\n const integrationConfig = integrations.bitbucketCloud.byHost(host);\n\n const authorization = getAuthorizationHeader(\n token ? { token } : integrationConfig!.config,\n );\n let response: Response;\n try {\n response = await fetch(\n `https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}/pipelines`,\n {\n method: 'POST',\n headers: {\n Authorization: authorization,\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body) ?? {},\n },\n );\n } catch (e) {\n throw new Error(`Unable to run pipeline, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to run pipeline, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const responseObject = await response.json();\n\n ctx.output('buildNumber', responseObject.build_number);\n ctx.output('repoUrl', responseObject.repository.links.html.href);\n ctx.output(\n 'pipelinesUrl',\n `${responseObject.repository.links.html.href}/pipelines`,\n );\n },\n });\n};\n","/*\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} from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * @public\n * The Bitbucket Cloud Module for the Scaffolder Backend\n */\nexport const bitbucketCloudModule = createBackendModule({\n moduleId: 'bitbucketCloud',\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 createBitbucketPipelinesRunAction({ integrations }),\n );\n },\n });\n },\n});\n"],"names":["examples","yaml","fetch","createTemplateAction","parseRepoUrl","InputError","initRepoAndPush","getRepoSourceDirectory","id","inputProps.workspace","inputProps.repo_slug","inputProps.pipelinesRunBody","inputProps.token","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;AAgBa,MAAA,sBAAA,GAAyB,CAAC,MAIjC,KAAA;AACJ,EAAI,IAAA,MAAA,CAAO,QAAY,IAAA,MAAA,CAAO,WAAa,EAAA;AACzC,IAAA,MAAM,SAAS,MAAO,CAAA,IAAA;AAAA,MACpB,CAAG,EAAA,MAAA,CAAO,QAAQ,CAAA,CAAA,EAAI,OAAO,WAAW,CAAA,CAAA;AAAA,MACxC,MAAA;AAAA,KACF,CAAA;AAEA,IAAA,OAAO,CAAS,MAAA,EAAA,MAAA,CAAO,QAAS,CAAA,QAAQ,CAAC,CAAA,CAAA,CAAA;AAAA,GAC3C;AAEA,EAAA,IAAI,OAAO,KAAO,EAAA;AAChB,IAAO,OAAA,CAAA,OAAA,EAAU,OAAO,KAAK,CAAA,CAAA,CAAA;AAAA,GAC/B;AAEA,EAAA,MAAM,IAAI,KAAA;AA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UAC1D,iCAAA,CAAkC,EAAE,YAAA,EAAc,CAAA;AAAA,SACpD,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/actions/helpers.ts","../src/actions/bitbucketCloud.examples.ts","../src/actions/bitbucketCloud.ts","../src/actions/bitbucketCloudPipelinesRun.examples.ts","../src/actions/inputProperties.ts","../src/actions/bitbucketCloudPipelinesRun.ts","../src/autocomplete/autocomplete.ts","../src/module.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\nexport const getAuthorizationHeader = (config: {\n username?: string;\n appPassword?: string;\n token?: string;\n}) => {\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 Cloud. Please add either username + appPassword to the Integrations config or a user login auth token`,\n );\n};\n","/*\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 Cloud with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Bitbucket Cloud repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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 Cloud repository with public repo visibility, if not set defaults to private',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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 Cloud repository with a default Branch, if not set defaults to master',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n sourcePath: './repoRoot',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket Cloud repository with a custom authentication token',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\n input: {\n repoUrl:\n 'bitbucket.org?repo=repo&workspace=workspace&project=project',\n token: 'your-custom-auth-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Bitbucket Cloud repository with all proporties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:bitbucketCloud',\n name: 'Publish to Bitbucket Cloud',\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-custom-auth-token',\n },\n },\n ],\n }),\n },\n];\n","/*\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport {\n createTemplateAction,\n initRepoAndPush,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport fetch, { Response, RequestInit } from 'node-fetch';\n\nimport { Config } from '@backstage/config';\nimport { getAuthorizationHeader } from './helpers';\nimport { examples } from './bitbucketCloud.examples';\n\nconst createRepository = 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\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to Bitbucket Cloud.\n * @public\n */\nexport function createPublishBitbucketCloudAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n defaultBranch?: string;\n repoVisibility?: 'private' | 'public';\n sourcePath?: string;\n token?: string;\n }>({\n id: 'publish:bitbucketCloud',\n examples,\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Bitbucket Cloud.',\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n description: {\n title: 'Repository Description',\n type: 'string',\n },\n repoVisibility: {\n title: 'Repository Visibility',\n type: 'string',\n enum: ['private', 'public'],\n },\n defaultBranch: {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\n },\n sourcePath: {\n title: 'Source Path',\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 type: 'string',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description:\n 'The token to use for authorization to BitBucket Cloud',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: {\n title: 'A URL to the repository with the provider',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the root of the repository',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the initial commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n defaultBranch = 'master',\n repoVisibility = 'private',\n } = ctx.input;\n\n const { workspace, project, repo, host } = parseRepoUrl(\n repoUrl,\n integrations,\n );\n\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 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.bitbucketCloud.byHost(host);\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 ? { token: ctx.input.token } : integrationConfig.config,\n );\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const { remoteUrl, repoContentsUrl } = await createRepository({\n authorization,\n workspace: workspace || '',\n project,\n repo,\n repoVisibility,\n mainBranch: defaultBranch,\n description,\n apiBaseUrl,\n });\n\n const gitAuthorInfo = {\n name: config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: config.getOptionalString('scaffolder.defaultAuthor.email'),\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 if (\n !integrationConfig.config.username ||\n !integrationConfig.config.appPassword\n ) {\n throw new Error(\n 'Credentials for Bitbucket Cloud integration required for this action.',\n );\n }\n\n auth = {\n username: integrationConfig.config.username,\n password: integrationConfig.config.appPassword,\n };\n }\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: config.getOptionalString(\n 'scaffolder.defaultCommitMessage',\n ),\n gitAuthorInfo,\n });\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n","/*\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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Trigger a pipeline for a branch',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n ref_type: 'branch',\n type: 'pipeline_ref_target',\n ref_name: 'master',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a pipeline for a commit on a branch',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n commit: {\n type: 'commit',\n hash: 'ce5b7431602f7cbba007062eeb55225c6e18e956',\n },\n ref_type: 'branch',\n type: 'pipeline_ref_target',\n ref_name: 'master',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a specific pipeline definition for a commit',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n commit: {\n type: 'commit',\n hash: 'a3c4e02c9a3755eccdc3764e6ea13facdf30f923',\n },\n selector: {\n type: 'custom',\n pattern: 'Deploy to production',\n },\n type: 'pipeline_commit_target',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description:\n 'Trigger a specific pipeline definition for a commit on a branch or tag',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n commit: {\n type: 'commit',\n hash: 'a3c4e02c9a3755eccdc3764e6ea13facdf30f923',\n },\n selector: {\n type: 'custom',\n pattern: 'Deploy to production',\n },\n type: 'pipeline_ref_target',\n ref_name: 'master',\n ref_type: 'branch',\n },\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a custom pipeline with variables',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n type: 'pipeline_ref_target',\n ref_name: 'master',\n ref_type: 'branch',\n selector: {\n type: 'custom',\n pattern: 'Deploy to production',\n },\n },\n variables: [\n { key: 'var1key', value: 'var1value', secured: true },\n {\n key: 'var2key',\n value: 'var2value',\n },\n ],\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a pull request pipeline',\n example: yaml.stringify({\n steps: [\n {\n action: 'bitbucket:pipelines:run',\n id: 'run-bitbucket-pipeline',\n name: 'Run an example bitbucket pipeline',\n input: {\n workspace: 'test-workspace',\n repo_slug: 'test-repo-slug',\n body: {\n target: {\n type: 'pipeline_pullrequest_target',\n source: 'pull-request-branch',\n destination: 'master',\n destination_commit: {\n hash: '9f848b7',\n },\n commit: {\n hash: '1a372fc',\n },\n pull_request: {\n id: '3',\n },\n selector: {\n type: 'pull-requests',\n pattern: '**',\n },\n },\n },\n },\n },\n ],\n }),\n },\n];\n","/*\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\nconst workspace = {\n title: 'Workspace',\n description: `The workspace name`,\n type: 'string',\n};\n\nconst repo_slug = {\n title: 'Repository name',\n description: 'The repository name',\n type: 'string',\n};\n\nconst ref_type = {\n title: 'ref_type',\n type: 'string',\n};\n\nconst type = {\n title: 'type',\n type: 'string',\n};\n\nconst ref_name = {\n title: 'ref_name',\n type: 'string',\n};\nconst source = {\n title: 'source',\n type: 'string',\n};\nconst destination = {\n title: 'destination',\n type: 'string',\n};\nconst hash = {\n title: 'hash',\n type: 'string',\n};\n\nconst pattern = {\n title: 'pattern',\n type: 'string',\n};\n\nconst id = {\n title: 'id',\n type: 'string',\n};\n\nconst key = {\n title: 'key',\n type: 'string',\n};\nconst value = {\n title: 'value',\n type: 'string',\n};\nconst secured = {\n title: 'secured',\n type: 'boolean',\n};\n\nconst token = {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to BitBucket Cloud',\n};\n\nconst destination_commit = {\n title: 'destination_commit',\n type: 'object',\n properties: {\n hash,\n },\n};\n\nconst commit = {\n title: 'commit',\n type: 'object',\n properties: {\n type,\n hash,\n },\n};\n\nconst selector = {\n title: 'selector',\n type: 'object',\n properties: {\n type,\n pattern,\n },\n};\n\nconst pull_request = {\n title: 'pull_request',\n type: 'object',\n properties: {\n id,\n },\n};\n\nconst pipelinesRunBody = {\n title: 'Request Body',\n description:\n 'Request body properties: see Bitbucket Cloud Rest API documentation for more details',\n type: 'object',\n properties: {\n target: {\n title: 'target',\n type: 'object',\n properties: {\n ref_type,\n type,\n ref_name,\n source,\n destination,\n destination_commit,\n commit,\n selector,\n pull_request,\n },\n },\n variables: {\n title: 'variables',\n type: 'array',\n items: {\n type: 'object',\n properties: {\n key,\n value,\n secured,\n },\n },\n },\n },\n};\n\nexport { workspace, repo_slug, pipelinesRunBody, token };\n","/*\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 { examples } from './bitbucketCloudPipelinesRun.examples';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport fetch, { Response } from 'node-fetch';\nimport * as inputProps from './inputProperties';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { getAuthorizationHeader } from './helpers';\n\nconst id = 'bitbucket:pipelines:run';\n/**\n * Creates a new action that triggers a run of a bitbucket pipeline\n *\n * @public\n */\nexport const createBitbucketPipelinesRunAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction<{\n workspace: string;\n repo_slug: string;\n body?: object;\n token?: string;\n }>({\n id,\n description: 'Run a bitbucket cloud pipeline',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['workspace', 'repo_slug'],\n properties: {\n workspace: inputProps.workspace,\n repo_slug: inputProps.repo_slug,\n body: inputProps.pipelinesRunBody,\n token: inputProps.token,\n },\n },\n output: {\n type: 'object',\n properties: {\n buildNumber: {\n title: 'Build number',\n type: 'number',\n },\n repoUrl: {\n title: 'A URL to the pipeline repositry',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the pipeline',\n type: 'string',\n },\n },\n },\n },\n supportsDryRun: false,\n async handler(ctx) {\n const { workspace, repo_slug, body, token } = ctx.input;\n const host = 'bitbucket.org';\n const integrationConfig = integrations.bitbucketCloud.byHost(host);\n\n const authorization = getAuthorizationHeader(\n token ? { token } : integrationConfig!.config,\n );\n let response: Response;\n try {\n response = await fetch(\n `https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}/pipelines`,\n {\n method: 'POST',\n headers: {\n Authorization: authorization,\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(body) ?? {},\n },\n );\n } catch (e) {\n throw new Error(`Unable to run pipeline, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to run pipeline, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const responseObject = await response.json();\n\n ctx.output('buildNumber', responseObject.build_number);\n ctx.output('repoUrl', responseObject.repository.links.html.href);\n ctx.output(\n 'pipelinesUrl',\n `${responseObject.repository.links.html.href}/pipelines`,\n );\n },\n });\n};\n","/*\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 */\n\nimport { InputError } from '@backstage/errors';\nimport { BitbucketCloudClient } from '@backstage/plugin-bitbucket-cloud-common';\n\nexport async function handleAutocompleteRequest({\n resource,\n token,\n context,\n}: {\n resource: string;\n token: string;\n context: Record<string, string>;\n}): Promise<{ results: { title: string }[] }> {\n const client = BitbucketCloudClient.fromConfig({\n host: 'bitbucket.org',\n apiBaseUrl: 'https://api.bitbucket.org/2.0',\n token,\n });\n\n switch (resource) {\n case 'workspaces': {\n const result: string[] = [];\n\n for await (const page of client.listWorkspaces().iteratePages()) {\n const slugs = [...page.values!].map(p => p.slug!);\n result.push(...slugs);\n }\n\n return { results: result.map(title => ({ title })) };\n }\n case 'projects': {\n if (!context.workspace)\n throw new InputError('Missing workspace context parameter');\n\n const result: string[] = [];\n\n for await (const page of client\n .listProjectsByWorkspace(context.workspace)\n .iteratePages()) {\n const keys = [...page.values!].map(p => p.key!);\n result.push(...keys);\n }\n\n return { results: result.map(title => ({ title })) };\n }\n case 'repositories': {\n if (!context.workspace || !context.project)\n throw new InputError(\n 'Missing workspace and/or project context parameter',\n );\n\n const result: string[] = [];\n\n for await (const page of client\n .listRepositoriesByWorkspace(context.workspace, {\n q: `project.key=\"${context.project}\"`,\n })\n .iteratePages()) {\n const slugs = [...page.values!].map(p => p.slug!);\n result.push(...slugs);\n }\n\n return { results: result.map(title => ({ title })) };\n }\n default:\n throw new InputError(`Invalid resource: ${resource}`);\n }\n}\n","/*\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 {\n scaffolderActionsExtensionPoint,\n scaffolderAutocompleteExtensionPoint,\n} from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createBitbucketPipelinesRunAction,\n createPublishBitbucketCloudAction,\n} from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { handleAutocompleteRequest } from './autocomplete/autocomplete';\n\n/**\n * @public\n * The Bitbucket Cloud Module for the Scaffolder Backend\n */\nexport const bitbucketCloudModule = createBackendModule({\n moduleId: 'bitbucketCloud',\n pluginId: 'scaffolder',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n autocomplete: scaffolderAutocompleteExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, config, autocomplete }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n scaffolder.addActions(\n createPublishBitbucketCloudAction({ integrations, config }),\n createBitbucketPipelinesRunAction({ integrations }),\n );\n\n autocomplete.addAutocompleteProvider({\n id: 'bitbucket-cloud',\n handler: handleAutocompleteRequest,\n });\n },\n });\n },\n});\n"],"names":["examples","yaml","fetch","createTemplateAction","parseRepoUrl","InputError","initRepoAndPush","getRepoSourceDirectory","id","inputProps.workspace","inputProps.repo_slug","inputProps.pipelinesRunBody","inputProps.token","BitbucketCloudClient","createBackendModule","scaffolderActionsExtensionPoint","scaffolderAutocompleteExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;AAgBa,MAAA,sBAAA,GAAyB,CAAC,MAIjC,KAAA;AACJ,EAAI,IAAA,MAAA,CAAO,QAAY,IAAA,MAAA,CAAO,WAAa,EAAA;AACzC,IAAA,MAAM,SAAS,MAAO,CAAA,IAAA;AAAA,MACpB,CAAG,EAAA,MAAA,CAAO,QAAQ,CAAA,CAAA,EAAI,OAAO,WAAW,CAAA,CAAA;AAAA,MACxC,MAAA;AAAA,KACF,CAAA;AAEA,IAAA,OAAO,CAAS,MAAA,EAAA,MAAA,CAAO,QAAS,CAAA,QAAQ,CAAC,CAAA,CAAA,CAAA;AAAA,GAC3C;AAEA,EAAA,IAAI,OAAO,KAAO,EAAA;AAChB,IAAO,OAAA,CAAA,OAAA,EAAU,OAAO,KAAK,CAAA,CAAA,CAAA;AAAA,GAC/B;AAEA,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,CAAA,uJAAA,CAAA;AAAA,GACF,CAAA;AACF,CAAA;;AClBO,MAAMA,UAA8B,GAAA;AAAA,EACzC;AAAA,IACE,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version": "0.1.11",
3
+ "version": "0.1.12-next.1",
4
4
  "description": "The Bitbucket Cloud module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -39,19 +39,20 @@
39
39
  "test": "backstage-cli package test"
40
40
  },
41
41
  "dependencies": {
42
- "@backstage/backend-plugin-api": "^0.6.21",
42
+ "@backstage/backend-plugin-api": "^0.6.22-next.1",
43
43
  "@backstage/config": "^1.2.0",
44
44
  "@backstage/errors": "^1.2.4",
45
- "@backstage/integration": "^1.12.0",
46
- "@backstage/plugin-scaffolder-node": "^0.4.7",
45
+ "@backstage/integration": "^1.13.0-next.0",
46
+ "@backstage/plugin-bitbucket-cloud-common": "^0.2.21-next.0",
47
+ "@backstage/plugin-scaffolder-node": "^0.4.8-next.1",
47
48
  "fs-extra": "^11.2.0",
48
49
  "node-fetch": "^2.6.7",
49
50
  "yaml": "^2.0.0"
50
51
  },
51
52
  "devDependencies": {
52
- "@backstage/backend-test-utils": "^0.4.3",
53
- "@backstage/cli": "^0.26.10",
54
- "@backstage/plugin-scaffolder-node-test-utils": "^0.1.8",
53
+ "@backstage/backend-test-utils": "^0.4.4-next.1",
54
+ "@backstage/cli": "^0.26.11-next.1",
55
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.1.9-next.1",
55
56
  "msw": "^1.0.0"
56
57
  }
57
58
  }