@backstage/integration 1.12.0-next.0 → 1.12.0-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,5 +1,25 @@
1
1
  # @backstage/integration
2
2
 
3
+ ## 1.12.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - be1014d: **BREAKING** Removed deprecated code from when casing was changed from `GitHub` to `Github` nearly two years ago. The following items have been removed:
8
+
9
+ - `getGitHubFileFetchUrl` (use `getGithubFileFetchUrl` instead)
10
+ - `GitHubIntegrationConfig` (use `GithubIntegrationConfig` instead)
11
+ - `GitHubIntegration` (use `GithubIntegration` instead)
12
+ - `readGitHubIntegrationConfig` (use `readGithubIntegrationConfig` instead)
13
+ - `readGitHubIntegrationConfigs` (use `readGithubIntegrationConfigs` instead)
14
+ - `replaceGitHubUrlType` (use `replaceGithubUrlType` instead)
15
+
16
+ ### Patch Changes
17
+
18
+ - 23ee9ab: Fix AWS CodeCommit integration by allowing to change the host
19
+ - Updated dependencies
20
+ - @backstage/config@1.2.0
21
+ - @backstage/errors@1.2.4
22
+
3
23
  ## 1.12.0-next.0
4
24
 
5
25
  ### Minor Changes
@@ -4,23 +4,19 @@ function readAwsCodeCommitIntegrationConfig(config) {
4
4
  const secretAccessKey = config.getOptionalString("secretAccessKey")?.trim();
5
5
  const roleArn = config.getOptionalString("roleArn");
6
6
  const externalId = config.getOptionalString("externalId");
7
- const host = AMAZON_AWS_CODECOMMIT_HOST;
7
+ const region = config.getString("region");
8
+ const host = config.getOptionalString("host") || `${region}.${AMAZON_AWS_CODECOMMIT_HOST}`;
8
9
  return {
9
10
  host,
10
11
  accessKeyId,
11
12
  secretAccessKey,
12
13
  roleArn,
13
- externalId
14
+ externalId,
15
+ region
14
16
  };
15
17
  }
16
18
  function readAwsCodeCommitIntegrationConfigs(configs) {
17
- const result = configs.map(readAwsCodeCommitIntegrationConfig);
18
- if (!result.some((c) => c.host === AMAZON_AWS_CODECOMMIT_HOST)) {
19
- result.push({
20
- host: AMAZON_AWS_CODECOMMIT_HOST
21
- });
22
- }
23
- return result;
19
+ return configs.map(readAwsCodeCommitIntegrationConfig);
24
20
  }
25
21
 
26
22
  export { readAwsCodeCommitIntegrationConfig, readAwsCodeCommitIntegrationConfigs };
@@ -1 +1 @@
1
- {"version":3,"file":"config.esm.js","sources":["../../src/awsCodeCommit/config.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { Config } from '@backstage/config';\n\nconst AMAZON_AWS_CODECOMMIT_HOST = 'console.aws.amazon.com';\n\n/**\n * The configuration parameters for a single AWS CodeCommit provider.\n *\n * @public\n */\nexport type AwsCodeCommitIntegrationConfig = {\n /**\n * Host, git host derived from region\n */\n host: string;\n\n /**\n * (Optional) User access key id\n */\n accessKeyId?: string;\n\n /**\n * (Optional) User secret access key\n */\n secretAccessKey?: string;\n\n /**\n * (Optional) ARN of role to be assumed\n */\n roleArn?: string;\n\n /**\n * (Optional) External ID to use when assuming role\n */\n externalId?: string;\n};\n\n/**\n * Reads a single Aws CodeCommit integration config.\n *\n * @param config - The config object of a single integration\n * @public\n */\n\nexport function readAwsCodeCommitIntegrationConfig(\n config: Config,\n): AwsCodeCommitIntegrationConfig {\n const accessKeyId = config.getOptionalString('accessKeyId');\n const secretAccessKey = config.getOptionalString('secretAccessKey')?.trim();\n const roleArn = config.getOptionalString('roleArn');\n const externalId = config.getOptionalString('externalId');\n const host = AMAZON_AWS_CODECOMMIT_HOST;\n\n return {\n host,\n accessKeyId,\n secretAccessKey,\n roleArn,\n externalId,\n };\n}\n\n/**\n * Reads a set of AWS CodeCommit integration configs, and inserts some defaults for\n * public Amazon AWS if not specified.\n *\n * @param configs - The config objects of the integrations\n * @public\n */\nexport function readAwsCodeCommitIntegrationConfigs(\n configs: Config[],\n): AwsCodeCommitIntegrationConfig[] {\n // First read all the explicit integrations\n const result = configs.map(readAwsCodeCommitIntegrationConfig);\n\n // If no explicit console.aws.amazon.com integration was added, put one in the list as\n // a convenience\n if (!result.some(c => c.host === AMAZON_AWS_CODECOMMIT_HOST)) {\n result.push({\n host: AMAZON_AWS_CODECOMMIT_HOST,\n });\n }\n\n return result;\n}\n"],"names":[],"mappings":"AAkBA,MAAM,0BAA6B,GAAA,wBAAA,CAAA;AAyC5B,SAAS,mCACd,MACgC,EAAA;AAChC,EAAM,MAAA,WAAA,GAAc,MAAO,CAAA,iBAAA,CAAkB,aAAa,CAAA,CAAA;AAC1D,EAAA,MAAM,eAAkB,GAAA,MAAA,CAAO,iBAAkB,CAAA,iBAAiB,GAAG,IAAK,EAAA,CAAA;AAC1E,EAAM,MAAA,OAAA,GAAU,MAAO,CAAA,iBAAA,CAAkB,SAAS,CAAA,CAAA;AAClD,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,iBAAA,CAAkB,YAAY,CAAA,CAAA;AACxD,EAAA,MAAM,IAAO,GAAA,0BAAA,CAAA;AAEb,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,GACF,CAAA;AACF,CAAA;AASO,SAAS,oCACd,OACkC,EAAA;AAElC,EAAM,MAAA,MAAA,GAAS,OAAQ,CAAA,GAAA,CAAI,kCAAkC,CAAA,CAAA;AAI7D,EAAA,IAAI,CAAC,MAAO,CAAA,IAAA,CAAK,OAAK,CAAE,CAAA,IAAA,KAAS,0BAA0B,CAAG,EAAA;AAC5D,IAAA,MAAA,CAAO,IAAK,CAAA;AAAA,MACV,IAAM,EAAA,0BAAA;AAAA,KACP,CAAA,CAAA;AAAA,GACH;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"config.esm.js","sources":["../../src/awsCodeCommit/config.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { Config } from '@backstage/config';\n\nconst AMAZON_AWS_CODECOMMIT_HOST = 'console.aws.amazon.com';\n\n/**\n * The configuration parameters for a single AWS CodeCommit provider.\n *\n * @public\n */\nexport type AwsCodeCommitIntegrationConfig = {\n /**\n * Host, git host derived from region\n */\n host: string;\n\n /**\n * (Optional) User access key id\n */\n accessKeyId?: string;\n\n /**\n * (Optional) User secret access key\n */\n secretAccessKey?: string;\n\n /**\n * (Optional) ARN of role to be assumed\n */\n roleArn?: string;\n\n /**\n * (Optional) External ID to use when assuming role\n */\n externalId?: string;\n\n /**\n * region to use for AWS (default: us-east-1)\n */\n region: string;\n};\n\n/**\n * Reads a single Aws CodeCommit integration config.\n *\n * @param config - The config object of a single integration\n * @public\n */\n\nexport function readAwsCodeCommitIntegrationConfig(\n config: Config,\n): AwsCodeCommitIntegrationConfig {\n const accessKeyId = config.getOptionalString('accessKeyId');\n const secretAccessKey = config.getOptionalString('secretAccessKey')?.trim();\n const roleArn = config.getOptionalString('roleArn');\n const externalId = config.getOptionalString('externalId');\n const region = config.getString('region');\n const host =\n config.getOptionalString('host') ||\n `${region}.${AMAZON_AWS_CODECOMMIT_HOST}`;\n\n return {\n host,\n accessKeyId,\n secretAccessKey,\n roleArn,\n externalId,\n region,\n };\n}\n\n/**\n * Reads a set of AWS CodeCommit integration configs, and inserts some defaults for\n * public Amazon AWS if not specified.\n *\n * @param configs - The config objects of the integrations\n * @public\n */\nexport function readAwsCodeCommitIntegrationConfigs(\n configs: Config[],\n): AwsCodeCommitIntegrationConfig[] {\n return configs.map(readAwsCodeCommitIntegrationConfig);\n}\n"],"names":[],"mappings":"AAkBA,MAAM,0BAA6B,GAAA,wBAAA,CAAA;AA8C5B,SAAS,mCACd,MACgC,EAAA;AAChC,EAAM,MAAA,WAAA,GAAc,MAAO,CAAA,iBAAA,CAAkB,aAAa,CAAA,CAAA;AAC1D,EAAA,MAAM,eAAkB,GAAA,MAAA,CAAO,iBAAkB,CAAA,iBAAiB,GAAG,IAAK,EAAA,CAAA;AAC1E,EAAM,MAAA,OAAA,GAAU,MAAO,CAAA,iBAAA,CAAkB,SAAS,CAAA,CAAA;AAClD,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,iBAAA,CAAkB,YAAY,CAAA,CAAA;AACxD,EAAM,MAAA,MAAA,GAAS,MAAO,CAAA,SAAA,CAAU,QAAQ,CAAA,CAAA;AACxC,EAAM,MAAA,IAAA,GACJ,OAAO,iBAAkB,CAAA,MAAM,KAC/B,CAAG,EAAA,MAAM,IAAI,0BAA0B,CAAA,CAAA,CAAA;AAEzC,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,MAAA;AAAA,GACF,CAAA;AACF,CAAA;AASO,SAAS,oCACd,OACkC,EAAA;AAClC,EAAO,OAAA,OAAA,CAAQ,IAAI,kCAAkC,CAAA,CAAA;AACvD;;;;"}
package/dist/index.cjs.js CHANGED
@@ -155,23 +155,19 @@ function readAwsCodeCommitIntegrationConfig(config) {
155
155
  const secretAccessKey = config.getOptionalString("secretAccessKey")?.trim();
156
156
  const roleArn = config.getOptionalString("roleArn");
157
157
  const externalId = config.getOptionalString("externalId");
158
- const host = AMAZON_AWS_CODECOMMIT_HOST;
158
+ const region = config.getString("region");
159
+ const host = config.getOptionalString("host") || `${region}.${AMAZON_AWS_CODECOMMIT_HOST}`;
159
160
  return {
160
161
  host,
161
162
  accessKeyId,
162
163
  secretAccessKey,
163
164
  roleArn,
164
- externalId
165
+ externalId,
166
+ region
165
167
  };
166
168
  }
167
169
  function readAwsCodeCommitIntegrationConfigs(configs) {
168
- const result = configs.map(readAwsCodeCommitIntegrationConfig);
169
- if (!result.some((c) => c.host === AMAZON_AWS_CODECOMMIT_HOST)) {
170
- result.push({
171
- host: AMAZON_AWS_CODECOMMIT_HOST
172
- });
173
- }
174
- return result;
170
+ return configs.map(readAwsCodeCommitIntegrationConfig);
175
171
  }
176
172
 
177
173
  class AwsCodeCommitIntegration {
@@ -1876,20 +1872,6 @@ function replaceGithubUrlType(url, type) {
1876
1872
  );
1877
1873
  }
1878
1874
 
1879
- const getGitHubFileFetchUrl = getGithubFileFetchUrl;
1880
- class GitHubIntegration extends GithubIntegration {
1881
- static factory = GithubIntegration.factory;
1882
- constructor(integrationConfig) {
1883
- super(integrationConfig);
1884
- }
1885
- get config() {
1886
- return super.config;
1887
- }
1888
- }
1889
- const readGitHubIntegrationConfig = readGithubIntegrationConfig;
1890
- const readGitHubIntegrationConfigs = readGithubIntegrationConfigs;
1891
- const replaceGitHubUrlType = replaceGithubUrlType;
1892
-
1893
1875
  const GITLAB_HOST = "gitlab.com";
1894
1876
  const GITLAB_API_BASE_URL = "https://gitlab.com/api/v4";
1895
1877
  function readGitLabIntegrationConfig(config) {
@@ -2311,7 +2293,6 @@ exports.DefaultAzureDevOpsCredentialsProvider = DefaultAzureDevOpsCredentialsPro
2311
2293
  exports.DefaultGithubCredentialsProvider = DefaultGithubCredentialsProvider;
2312
2294
  exports.DefaultGitlabCredentialsProvider = DefaultGitlabCredentialsProvider;
2313
2295
  exports.GerritIntegration = GerritIntegration;
2314
- exports.GitHubIntegration = GitHubIntegration;
2315
2296
  exports.GitLabIntegration = GitLabIntegration;
2316
2297
  exports.GiteaIntegration = GiteaIntegration;
2317
2298
  exports.GithubAppCredentialsMux = GithubAppCredentialsMux;
@@ -2342,7 +2323,6 @@ exports.getGerritCloneRepoUrl = getGerritCloneRepoUrl;
2342
2323
  exports.getGerritFileContentsApiUrl = getGerritFileContentsApiUrl;
2343
2324
  exports.getGerritProjectsApiUrl = getGerritProjectsApiUrl;
2344
2325
  exports.getGerritRequestOptions = getGerritRequestOptions;
2345
- exports.getGitHubFileFetchUrl = getGitHubFileFetchUrl;
2346
2326
  exports.getGitHubRequestOptions = getGitHubRequestOptions;
2347
2327
  exports.getGitLabFileFetchUrl = getGitLabFileFetchUrl;
2348
2328
  exports.getGitLabIntegrationRelativePath = getGitLabIntegrationRelativePath;
@@ -2375,8 +2355,6 @@ exports.readBitbucketServerIntegrationConfig = readBitbucketServerIntegrationCon
2375
2355
  exports.readBitbucketServerIntegrationConfigs = readBitbucketServerIntegrationConfigs;
2376
2356
  exports.readGerritIntegrationConfig = readGerritIntegrationConfig;
2377
2357
  exports.readGerritIntegrationConfigs = readGerritIntegrationConfigs;
2378
- exports.readGitHubIntegrationConfig = readGitHubIntegrationConfig;
2379
- exports.readGitHubIntegrationConfigs = readGitHubIntegrationConfigs;
2380
2358
  exports.readGitLabIntegrationConfig = readGitLabIntegrationConfig;
2381
2359
  exports.readGitLabIntegrationConfigs = readGitLabIntegrationConfigs;
2382
2360
  exports.readGiteaConfig = readGiteaConfig;
@@ -2384,7 +2362,6 @@ exports.readGithubIntegrationConfig = readGithubIntegrationConfig;
2384
2362
  exports.readGithubIntegrationConfigs = readGithubIntegrationConfigs;
2385
2363
  exports.readGoogleGcsIntegrationConfig = readGoogleGcsIntegrationConfig;
2386
2364
  exports.readHarnessConfig = readHarnessConfig;
2387
- exports.replaceGitHubUrlType = replaceGitHubUrlType;
2388
2365
  exports.replaceGitLabUrlType = replaceGitLabUrlType;
2389
2366
  exports.replaceGithubUrlType = replaceGithubUrlType;
2390
2367
  //# sourceMappingURL=index.cjs.js.map