@backstage/integration 1.19.0 → 1.19.2-next.0
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 +7 -0
- package/dist/ScmIntegrations.cjs.js +5 -0
- package/dist/ScmIntegrations.cjs.js.map +1 -1
- package/dist/ScmIntegrations.esm.js +5 -0
- package/dist/ScmIntegrations.esm.js.map +1 -1
- package/dist/github/GithubIntegration.cjs.js +1 -3
- package/dist/github/GithubIntegration.cjs.js.map +1 -1
- package/dist/github/GithubIntegration.esm.js +1 -3
- package/dist/github/GithubIntegration.esm.js.map +1 -1
- package/dist/googleGcs/GoogleGcsIntegration.cjs.js +39 -0
- package/dist/googleGcs/GoogleGcsIntegration.cjs.js.map +1 -0
- package/dist/googleGcs/GoogleGcsIntegration.esm.js +37 -0
- package/dist/googleGcs/GoogleGcsIntegration.esm.js.map +1 -0
- package/dist/googleGcs/config.cjs.js +9 -3
- package/dist/googleGcs/config.cjs.js.map +1 -1
- package/dist/googleGcs/config.esm.js +9 -4
- package/dist/googleGcs/config.esm.js.map +1 -1
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.esm.js +1 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,7 @@ require('lodash');
|
|
|
15
15
|
var HarnessIntegration = require('./harness/HarnessIntegration.cjs.js');
|
|
16
16
|
var AzureBlobStorageIntegration = require('./azureBlobStorage/AzureBlobStorageIntegration.cjs.js');
|
|
17
17
|
require('@azure/identity');
|
|
18
|
+
var GoogleGcsIntegration = require('./googleGcs/GoogleGcsIntegration.cjs.js');
|
|
18
19
|
|
|
19
20
|
class ScmIntegrations {
|
|
20
21
|
byType;
|
|
@@ -31,6 +32,7 @@ class ScmIntegrations {
|
|
|
31
32
|
github: GithubIntegration.GithubIntegration.factory({ config }),
|
|
32
33
|
gitlab: GitLabIntegration.GitLabIntegration.factory({ config }),
|
|
33
34
|
gitea: GiteaIntegration.GiteaIntegration.factory({ config }),
|
|
35
|
+
googleGcs: GoogleGcsIntegration.GoogleGcsIntegration.factory({ config }),
|
|
34
36
|
harness: HarnessIntegration.HarnessIntegration.factory({ config })
|
|
35
37
|
});
|
|
36
38
|
}
|
|
@@ -73,6 +75,9 @@ class ScmIntegrations {
|
|
|
73
75
|
get gitea() {
|
|
74
76
|
return this.byType.gitea;
|
|
75
77
|
}
|
|
78
|
+
get googleGcs() {
|
|
79
|
+
return this.byType.googleGcs;
|
|
80
|
+
}
|
|
76
81
|
get harness() {
|
|
77
82
|
return this.byType.harness;
|
|
78
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScmIntegrations.cjs.js","sources":["../src/ScmIntegrations.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';\nimport { AwsS3Integration } from './awsS3/AwsS3Integration';\nimport { AwsCodeCommitIntegration } from './awsCodeCommit/AwsCodeCommitIntegration';\nimport { AzureIntegration } from './azure/AzureIntegration';\nimport { BitbucketCloudIntegration } from './bitbucketCloud/BitbucketCloudIntegration';\nimport { BitbucketIntegration } from './bitbucket/BitbucketIntegration';\nimport { BitbucketServerIntegration } from './bitbucketServer/BitbucketServerIntegration';\nimport { GerritIntegration } from './gerrit/GerritIntegration';\nimport { GithubIntegration } from './github/GithubIntegration';\nimport { GitLabIntegration } from './gitlab/GitLabIntegration';\nimport { defaultScmResolveUrl } from './helpers';\nimport { ScmIntegration, ScmIntegrationsGroup } from './types';\nimport { ScmIntegrationRegistry } from './registry';\nimport { GiteaIntegration } from './gitea';\nimport { HarnessIntegration } from './harness/HarnessIntegration';\nimport { AzureBlobStorageIntergation } from './azureBlobStorage';\n\n/**\n * The set of supported integrations.\n *\n * @public\n */\nexport interface IntegrationsByType {\n awsS3: ScmIntegrationsGroup<AwsS3Integration>;\n awsCodeCommit: ScmIntegrationsGroup<AwsCodeCommitIntegration>;\n azureBlobStorage: ScmIntegrationsGroup<AzureBlobStorageIntergation>;\n azure: ScmIntegrationsGroup<AzureIntegration>;\n /**\n * @deprecated in favor of `bitbucketCloud` and `bitbucketServer`\n */\n bitbucket: ScmIntegrationsGroup<BitbucketIntegration>;\n bitbucketCloud: ScmIntegrationsGroup<BitbucketCloudIntegration>;\n bitbucketServer: ScmIntegrationsGroup<BitbucketServerIntegration>;\n gerrit: ScmIntegrationsGroup<GerritIntegration>;\n github: ScmIntegrationsGroup<GithubIntegration>;\n gitlab: ScmIntegrationsGroup<GitLabIntegration>;\n gitea: ScmIntegrationsGroup<GiteaIntegration>;\n harness: ScmIntegrationsGroup<HarnessIntegration>;\n}\n\n/**\n * Exposes the set of supported integrations.\n *\n * @public\n */\nexport class ScmIntegrations implements ScmIntegrationRegistry {\n private readonly byType: IntegrationsByType;\n\n static fromConfig(config: Config): ScmIntegrations {\n return new ScmIntegrations({\n awsS3: AwsS3Integration.factory({ config }),\n awsCodeCommit: AwsCodeCommitIntegration.factory({ config }),\n azureBlobStorage: AzureBlobStorageIntergation.factory({ config }),\n azure: AzureIntegration.factory({ config }),\n bitbucket: BitbucketIntegration.factory({ config }),\n bitbucketCloud: BitbucketCloudIntegration.factory({ config }),\n bitbucketServer: BitbucketServerIntegration.factory({ config }),\n gerrit: GerritIntegration.factory({ config }),\n github: GithubIntegration.factory({ config }),\n gitlab: GitLabIntegration.factory({ config }),\n gitea: GiteaIntegration.factory({ config }),\n harness: HarnessIntegration.factory({ config }),\n });\n }\n\n constructor(integrationsByType: IntegrationsByType) {\n this.byType = integrationsByType;\n }\n\n get awsS3(): ScmIntegrationsGroup<AwsS3Integration> {\n return this.byType.awsS3;\n }\n\n get awsCodeCommit(): ScmIntegrationsGroup<AwsCodeCommitIntegration> {\n return this.byType.awsCodeCommit;\n }\n\n get azureBlobStorage(): ScmIntegrationsGroup<AzureBlobStorageIntergation> {\n return this.byType.azureBlobStorage;\n }\n\n get azure(): ScmIntegrationsGroup<AzureIntegration> {\n return this.byType.azure;\n }\n\n /**\n * @deprecated in favor of `bitbucketCloud()` and `bitbucketServer()`\n */\n get bitbucket(): ScmIntegrationsGroup<BitbucketIntegration> {\n return this.byType.bitbucket;\n }\n\n get bitbucketCloud(): ScmIntegrationsGroup<BitbucketCloudIntegration> {\n return this.byType.bitbucketCloud;\n }\n\n get bitbucketServer(): ScmIntegrationsGroup<BitbucketServerIntegration> {\n return this.byType.bitbucketServer;\n }\n\n get gerrit(): ScmIntegrationsGroup<GerritIntegration> {\n return this.byType.gerrit;\n }\n\n get github(): ScmIntegrationsGroup<GithubIntegration> {\n return this.byType.github;\n }\n\n get gitlab(): ScmIntegrationsGroup<GitLabIntegration> {\n return this.byType.gitlab;\n }\n\n get gitea(): ScmIntegrationsGroup<GiteaIntegration> {\n return this.byType.gitea;\n }\n\n get harness(): ScmIntegrationsGroup<HarnessIntegration> {\n return this.byType.harness;\n }\n\n list(): ScmIntegration[] {\n return Object.values(this.byType).flatMap(\n i => i.list() as ScmIntegration[],\n );\n }\n\n byUrl(url: string | URL): ScmIntegration | undefined {\n let candidates = Object.values(this.byType)\n .map(i => i.byUrl(url))\n .filter(Boolean);\n\n // Do not return deprecated integrations if there are other options\n if (candidates.length > 1) {\n const filteredCandidates = candidates.filter(\n x => !(x instanceof BitbucketIntegration),\n );\n if (filteredCandidates.length !== 0) {\n candidates = filteredCandidates;\n }\n }\n\n return candidates[0];\n }\n\n byHost(host: string): ScmIntegration | undefined {\n return Object.values(this.byType)\n .map(i => i.byHost(host))\n .find(Boolean);\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n const integration = this.byUrl(options.base);\n if (!integration) {\n return defaultScmResolveUrl(options);\n }\n\n return integration.resolveUrl(options);\n }\n\n resolveEditUrl(url: string): string {\n const integration = this.byUrl(url);\n if (!integration) {\n return url;\n }\n\n return integration.resolveEditUrl(url);\n }\n}\n"],"names":["AwsS3Integration","AwsCodeCommitIntegration","AzureBlobStorageIntergation","AzureIntegration","BitbucketIntegration","BitbucketCloudIntegration","BitbucketServerIntegration","GerritIntegration","GithubIntegration","GitLabIntegration","GiteaIntegration","HarnessIntegration","defaultScmResolveUrl"],"mappings":";;;;;;;;;;;;;;;;;;AA6DO,MAAM,eAAA,CAAkD;AAAA,EAC5C,MAAA;AAAA,EAEjB,OAAO,WAAW,MAAA,EAAiC;AACjD,IAAA,OAAO,IAAI,eAAA,CAAgB;AAAA,MACzB,KAAA,EAAOA,iCAAA,CAAiB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC1C,aAAA,EAAeC,iDAAA,CAAyB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC1D,gBAAA,EAAkBC,uDAAA,CAA4B,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAChE,KAAA,EAAOC,iCAAA,CAAiB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC1C,SAAA,EAAWC,yCAAA,CAAqB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAClD,cAAA,EAAgBC,mDAAA,CAA0B,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC5D,eAAA,EAAiBC,qDAAA,CAA2B,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC9D,MAAA,EAAQC,mCAAA,CAAkB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC5C,MAAA,EAAQC,mCAAA,CAAkB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC5C,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ACrC;AAEA,IAAA,OAAO,WAAA,CAAY,WAAW,OAAO,CAAA;AAAA,EACvC;AAAA,EAEA,eAAe,GAAA,EAAqB;AAClC,IAAA,MAAM,WAAA,GAAc,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAClC,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA,OAAO,GAAA;AAAA,IACT;AAEA,IAAA,OAAO,WAAA,CAAY,eAAe,GAAG,CAAA;AAAA,EACvC;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"ScmIntegrations.cjs.js","sources":["../src/ScmIntegrations.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';\nimport { AwsS3Integration } from './awsS3/AwsS3Integration';\nimport { AwsCodeCommitIntegration } from './awsCodeCommit/AwsCodeCommitIntegration';\nimport { AzureIntegration } from './azure/AzureIntegration';\nimport { BitbucketCloudIntegration } from './bitbucketCloud/BitbucketCloudIntegration';\nimport { BitbucketIntegration } from './bitbucket/BitbucketIntegration';\nimport { BitbucketServerIntegration } from './bitbucketServer/BitbucketServerIntegration';\nimport { GerritIntegration } from './gerrit/GerritIntegration';\nimport { GithubIntegration } from './github/GithubIntegration';\nimport { GitLabIntegration } from './gitlab/GitLabIntegration';\nimport { defaultScmResolveUrl } from './helpers';\nimport { ScmIntegration, ScmIntegrationsGroup } from './types';\nimport { ScmIntegrationRegistry } from './registry';\nimport { GiteaIntegration } from './gitea';\nimport { HarnessIntegration } from './harness/HarnessIntegration';\nimport { AzureBlobStorageIntergation } from './azureBlobStorage';\nimport { GoogleGcsIntegration } from './googleGcs/GoogleGcsIntegration';\n\n/**\n * The set of supported integrations.\n *\n * @public\n */\nexport interface IntegrationsByType {\n awsS3: ScmIntegrationsGroup<AwsS3Integration>;\n awsCodeCommit: ScmIntegrationsGroup<AwsCodeCommitIntegration>;\n azureBlobStorage: ScmIntegrationsGroup<AzureBlobStorageIntergation>;\n azure: ScmIntegrationsGroup<AzureIntegration>;\n /**\n * @deprecated in favor of `bitbucketCloud` and `bitbucketServer`\n */\n bitbucket: ScmIntegrationsGroup<BitbucketIntegration>;\n bitbucketCloud: ScmIntegrationsGroup<BitbucketCloudIntegration>;\n bitbucketServer: ScmIntegrationsGroup<BitbucketServerIntegration>;\n gerrit: ScmIntegrationsGroup<GerritIntegration>;\n github: ScmIntegrationsGroup<GithubIntegration>;\n gitlab: ScmIntegrationsGroup<GitLabIntegration>;\n gitea: ScmIntegrationsGroup<GiteaIntegration>;\n googleGcs: ScmIntegrationsGroup<GoogleGcsIntegration>;\n harness: ScmIntegrationsGroup<HarnessIntegration>;\n}\n\n/**\n * Exposes the set of supported integrations.\n *\n * @public\n */\nexport class ScmIntegrations implements ScmIntegrationRegistry {\n private readonly byType: IntegrationsByType;\n\n static fromConfig(config: Config): ScmIntegrations {\n return new ScmIntegrations({\n awsS3: AwsS3Integration.factory({ config }),\n awsCodeCommit: AwsCodeCommitIntegration.factory({ config }),\n azureBlobStorage: AzureBlobStorageIntergation.factory({ config }),\n azure: AzureIntegration.factory({ config }),\n bitbucket: BitbucketIntegration.factory({ config }),\n bitbucketCloud: BitbucketCloudIntegration.factory({ config }),\n bitbucketServer: BitbucketServerIntegration.factory({ config }),\n gerrit: GerritIntegration.factory({ config }),\n github: GithubIntegration.factory({ config }),\n gitlab: GitLabIntegration.factory({ config }),\n gitea: GiteaIntegration.factory({ config }),\n googleGcs: GoogleGcsIntegration.factory({ config }),\n harness: HarnessIntegration.factory({ config }),\n });\n }\n\n constructor(integrationsByType: IntegrationsByType) {\n this.byType = integrationsByType;\n }\n\n get awsS3(): ScmIntegrationsGroup<AwsS3Integration> {\n return this.byType.awsS3;\n }\n\n get awsCodeCommit(): ScmIntegrationsGroup<AwsCodeCommitIntegration> {\n return this.byType.awsCodeCommit;\n }\n\n get azureBlobStorage(): ScmIntegrationsGroup<AzureBlobStorageIntergation> {\n return this.byType.azureBlobStorage;\n }\n\n get azure(): ScmIntegrationsGroup<AzureIntegration> {\n return this.byType.azure;\n }\n\n /**\n * @deprecated in favor of `bitbucketCloud()` and `bitbucketServer()`\n */\n get bitbucket(): ScmIntegrationsGroup<BitbucketIntegration> {\n return this.byType.bitbucket;\n }\n\n get bitbucketCloud(): ScmIntegrationsGroup<BitbucketCloudIntegration> {\n return this.byType.bitbucketCloud;\n }\n\n get bitbucketServer(): ScmIntegrationsGroup<BitbucketServerIntegration> {\n return this.byType.bitbucketServer;\n }\n\n get gerrit(): ScmIntegrationsGroup<GerritIntegration> {\n return this.byType.gerrit;\n }\n\n get github(): ScmIntegrationsGroup<GithubIntegration> {\n return this.byType.github;\n }\n\n get gitlab(): ScmIntegrationsGroup<GitLabIntegration> {\n return this.byType.gitlab;\n }\n\n get gitea(): ScmIntegrationsGroup<GiteaIntegration> {\n return this.byType.gitea;\n }\n\n get googleGcs(): ScmIntegrationsGroup<GoogleGcsIntegration> {\n return this.byType.googleGcs;\n }\n\n get harness(): ScmIntegrationsGroup<HarnessIntegration> {\n return this.byType.harness;\n }\n\n list(): ScmIntegration[] {\n return Object.values(this.byType).flatMap(\n i => i.list() as ScmIntegration[],\n );\n }\n\n byUrl(url: string | URL): ScmIntegration | undefined {\n let candidates = Object.values(this.byType)\n .map(i => i.byUrl(url))\n .filter(Boolean);\n\n // Do not return deprecated integrations if there are other options\n if (candidates.length > 1) {\n const filteredCandidates = candidates.filter(\n x => !(x instanceof BitbucketIntegration),\n );\n if (filteredCandidates.length !== 0) {\n candidates = filteredCandidates;\n }\n }\n\n return candidates[0];\n }\n\n byHost(host: string): ScmIntegration | undefined {\n return Object.values(this.byType)\n .map(i => i.byHost(host))\n .find(Boolean);\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n const integration = this.byUrl(options.base);\n if (!integration) {\n return defaultScmResolveUrl(options);\n }\n\n return integration.resolveUrl(options);\n }\n\n resolveEditUrl(url: string): string {\n const integration = this.byUrl(url);\n if (!integration) {\n return url;\n }\n\n return integration.resolveEditUrl(url);\n }\n}\n"],"names":["AwsS3Integration","AwsCodeCommitIntegration","AzureBlobStorageIntergation","AzureIntegration","BitbucketIntegration","BitbucketCloudIntegration","BitbucketServerIntegration","GerritIntegration","GithubIntegration","GitLabIntegration","GiteaIntegration","GoogleGcsIntegration","HarnessIntegration","defaultScmResolveUrl"],"mappings":";;;;;;;;;;;;;;;;;;;AA+DO,MAAM,eAAA,CAAkD;AAAA,EAC5C,MAAA;AAAA,EAEjB,OAAO,WAAW,MAAA,EAAiC;AACjD,IAAA,OAAO,IAAI,eAAA,CAAgB;AAAA,MACzB,KAAA,EAAOA,iCAAA,CAAiB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC1C,aAAA,EAAeC,iDAAA,CAAyB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC1D,gBAAA,EAAkBC,uDAAA,CAA4B,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAChE,KAAA,EAAOC,iCAAA,CAAiB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC1C,SAAA,EAAWC,yCAAA,CAAqB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAClD,cAAA,EAAgBC,mDAAA,CAA0B,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC5D,eAAA,EAAiBC,qDAAA,CAA2B,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC9D,MAAA,EAAQC,mCAAA,CAAkB,OAAA,CAAQ,EAAE,QAAQ,CAAA;AAAA,MAC5C,MAAA,EAAQC,mCAAA,CAAkB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AAAA,EACjB;AAAA,EAEA,WAAW,OAAA,EAIA;AACT,IAAA,MAAM,WAAA,GAAc,IAAA,CAAK,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA;AAC3C,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA,OAAOS,6BAAqB,OAAO,CAAA;AAAA,IACrC;AAEA,IAAA,OAAO,WAAA,CAAY,WAAW,OAAO,CAAA;AAAA,EACvC;AAAA,EAEA,eAAe,GAAA,EAAqB;AAClC,IAAA,MAAM,WAAA,GAAc,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAClC,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA,OAAO,GAAA;AAAA,IACT;AAEA,IAAA,OAAO,WAAA,CAAY,eAAe,GAAG,CAAA;AAAA,EACvC;AACF;;;;"}
|
|
@@ -13,6 +13,7 @@ import 'lodash';
|
|
|
13
13
|
import { HarnessIntegration } from './harness/HarnessIntegration.esm.js';
|
|
14
14
|
import { AzureBlobStorageIntergation } from './azureBlobStorage/AzureBlobStorageIntegration.esm.js';
|
|
15
15
|
import '@azure/identity';
|
|
16
|
+
import { GoogleGcsIntegration } from './googleGcs/GoogleGcsIntegration.esm.js';
|
|
16
17
|
|
|
17
18
|
class ScmIntegrations {
|
|
18
19
|
byType;
|
|
@@ -29,6 +30,7 @@ class ScmIntegrations {
|
|
|
29
30
|
github: GithubIntegration.factory({ config }),
|
|
30
31
|
gitlab: GitLabIntegration.factory({ config }),
|
|
31
32
|
gitea: GiteaIntegration.factory({ config }),
|
|
33
|
+
googleGcs: GoogleGcsIntegration.factory({ config }),
|
|
32
34
|
harness: HarnessIntegration.factory({ config })
|
|
33
35
|
});
|
|
34
36
|
}
|
|
@@ -71,6 +73,9 @@ class ScmIntegrations {
|
|
|
71
73
|
get gitea() {
|
|
72
74
|
return this.byType.gitea;
|
|
73
75
|
}
|
|
76
|
+
get googleGcs() {
|
|
77
|
+
return this.byType.googleGcs;
|
|
78
|
+
}
|
|
74
79
|
get harness() {
|
|
75
80
|
return this.byType.harness;
|
|
76
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScmIntegrations.esm.js","sources":["../src/ScmIntegrations.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';\nimport { AwsS3Integration } from './awsS3/AwsS3Integration';\nimport { AwsCodeCommitIntegration } from './awsCodeCommit/AwsCodeCommitIntegration';\nimport { AzureIntegration } from './azure/AzureIntegration';\nimport { BitbucketCloudIntegration } from './bitbucketCloud/BitbucketCloudIntegration';\nimport { BitbucketIntegration } from './bitbucket/BitbucketIntegration';\nimport { BitbucketServerIntegration } from './bitbucketServer/BitbucketServerIntegration';\nimport { GerritIntegration } from './gerrit/GerritIntegration';\nimport { GithubIntegration } from './github/GithubIntegration';\nimport { GitLabIntegration } from './gitlab/GitLabIntegration';\nimport { defaultScmResolveUrl } from './helpers';\nimport { ScmIntegration, ScmIntegrationsGroup } from './types';\nimport { ScmIntegrationRegistry } from './registry';\nimport { GiteaIntegration } from './gitea';\nimport { HarnessIntegration } from './harness/HarnessIntegration';\nimport { AzureBlobStorageIntergation } from './azureBlobStorage';\n\n/**\n * The set of supported integrations.\n *\n * @public\n */\nexport interface IntegrationsByType {\n awsS3: ScmIntegrationsGroup<AwsS3Integration>;\n awsCodeCommit: ScmIntegrationsGroup<AwsCodeCommitIntegration>;\n azureBlobStorage: ScmIntegrationsGroup<AzureBlobStorageIntergation>;\n azure: ScmIntegrationsGroup<AzureIntegration>;\n /**\n * @deprecated in favor of `bitbucketCloud` and `bitbucketServer`\n */\n bitbucket: ScmIntegrationsGroup<BitbucketIntegration>;\n bitbucketCloud: ScmIntegrationsGroup<BitbucketCloudIntegration>;\n bitbucketServer: ScmIntegrationsGroup<BitbucketServerIntegration>;\n gerrit: ScmIntegrationsGroup<GerritIntegration>;\n github: ScmIntegrationsGroup<GithubIntegration>;\n gitlab: ScmIntegrationsGroup<GitLabIntegration>;\n gitea: ScmIntegrationsGroup<GiteaIntegration>;\n harness: ScmIntegrationsGroup<HarnessIntegration>;\n}\n\n/**\n * Exposes the set of supported integrations.\n *\n * @public\n */\nexport class ScmIntegrations implements ScmIntegrationRegistry {\n private readonly byType: IntegrationsByType;\n\n static fromConfig(config: Config): ScmIntegrations {\n return new ScmIntegrations({\n awsS3: AwsS3Integration.factory({ config }),\n awsCodeCommit: AwsCodeCommitIntegration.factory({ config }),\n azureBlobStorage: AzureBlobStorageIntergation.factory({ config }),\n azure: AzureIntegration.factory({ config }),\n bitbucket: BitbucketIntegration.factory({ config }),\n bitbucketCloud: BitbucketCloudIntegration.factory({ config }),\n bitbucketServer: BitbucketServerIntegration.factory({ config }),\n gerrit: GerritIntegration.factory({ config }),\n github: GithubIntegration.factory({ config }),\n gitlab: GitLabIntegration.factory({ config }),\n gitea: GiteaIntegration.factory({ config }),\n harness: HarnessIntegration.factory({ config }),\n });\n }\n\n constructor(integrationsByType: IntegrationsByType) {\n this.byType = integrationsByType;\n }\n\n get awsS3(): ScmIntegrationsGroup<AwsS3Integration> {\n return this.byType.awsS3;\n }\n\n get awsCodeCommit(): ScmIntegrationsGroup<AwsCodeCommitIntegration> {\n return this.byType.awsCodeCommit;\n }\n\n get azureBlobStorage(): ScmIntegrationsGroup<AzureBlobStorageIntergation> {\n return this.byType.azureBlobStorage;\n }\n\n get azure(): ScmIntegrationsGroup<AzureIntegration> {\n return this.byType.azure;\n }\n\n /**\n * @deprecated in favor of `bitbucketCloud()` and `bitbucketServer()`\n */\n get bitbucket(): ScmIntegrationsGroup<BitbucketIntegration> {\n return this.byType.bitbucket;\n }\n\n get bitbucketCloud(): ScmIntegrationsGroup<BitbucketCloudIntegration> {\n return this.byType.bitbucketCloud;\n }\n\n get bitbucketServer(): ScmIntegrationsGroup<BitbucketServerIntegration> {\n return this.byType.bitbucketServer;\n }\n\n get gerrit(): ScmIntegrationsGroup<GerritIntegration> {\n return this.byType.gerrit;\n }\n\n get github(): ScmIntegrationsGroup<GithubIntegration> {\n return this.byType.github;\n }\n\n get gitlab(): ScmIntegrationsGroup<GitLabIntegration> {\n return this.byType.gitlab;\n }\n\n get gitea(): ScmIntegrationsGroup<GiteaIntegration> {\n return this.byType.gitea;\n }\n\n get harness(): ScmIntegrationsGroup<HarnessIntegration> {\n return this.byType.harness;\n }\n\n list(): ScmIntegration[] {\n return Object.values(this.byType).flatMap(\n i => i.list() as ScmIntegration[],\n );\n }\n\n byUrl(url: string | URL): ScmIntegration | undefined {\n let candidates = Object.values(this.byType)\n .map(i => i.byUrl(url))\n .filter(Boolean);\n\n // Do not return deprecated integrations if there are other options\n if (candidates.length > 1) {\n const filteredCandidates = candidates.filter(\n x => !(x instanceof BitbucketIntegration),\n );\n if (filteredCandidates.length !== 0) {\n candidates = filteredCandidates;\n }\n }\n\n return candidates[0];\n }\n\n byHost(host: string): ScmIntegration | undefined {\n return Object.values(this.byType)\n .map(i => i.byHost(host))\n .find(Boolean);\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n const integration = this.byUrl(options.base);\n if (!integration) {\n return defaultScmResolveUrl(options);\n }\n\n return integration.resolveUrl(options);\n }\n\n resolveEditUrl(url: string): string {\n const integration = this.byUrl(url);\n if (!integration) {\n return url;\n }\n\n return integration.resolveEditUrl(url);\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScmIntegrations.esm.js","sources":["../src/ScmIntegrations.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';\nimport { AwsS3Integration } from './awsS3/AwsS3Integration';\nimport { AwsCodeCommitIntegration } from './awsCodeCommit/AwsCodeCommitIntegration';\nimport { AzureIntegration } from './azure/AzureIntegration';\nimport { BitbucketCloudIntegration } from './bitbucketCloud/BitbucketCloudIntegration';\nimport { BitbucketIntegration } from './bitbucket/BitbucketIntegration';\nimport { BitbucketServerIntegration } from './bitbucketServer/BitbucketServerIntegration';\nimport { GerritIntegration } from './gerrit/GerritIntegration';\nimport { GithubIntegration } from './github/GithubIntegration';\nimport { GitLabIntegration } from './gitlab/GitLabIntegration';\nimport { defaultScmResolveUrl } from './helpers';\nimport { ScmIntegration, ScmIntegrationsGroup } from './types';\nimport { ScmIntegrationRegistry } from './registry';\nimport { GiteaIntegration } from './gitea';\nimport { HarnessIntegration } from './harness/HarnessIntegration';\nimport { AzureBlobStorageIntergation } from './azureBlobStorage';\nimport { GoogleGcsIntegration } from './googleGcs/GoogleGcsIntegration';\n\n/**\n * The set of supported integrations.\n *\n * @public\n */\nexport interface IntegrationsByType {\n awsS3: ScmIntegrationsGroup<AwsS3Integration>;\n awsCodeCommit: ScmIntegrationsGroup<AwsCodeCommitIntegration>;\n azureBlobStorage: ScmIntegrationsGroup<AzureBlobStorageIntergation>;\n azure: ScmIntegrationsGroup<AzureIntegration>;\n /**\n * @deprecated in favor of `bitbucketCloud` and `bitbucketServer`\n */\n bitbucket: ScmIntegrationsGroup<BitbucketIntegration>;\n bitbucketCloud: ScmIntegrationsGroup<BitbucketCloudIntegration>;\n bitbucketServer: ScmIntegrationsGroup<BitbucketServerIntegration>;\n gerrit: ScmIntegrationsGroup<GerritIntegration>;\n github: ScmIntegrationsGroup<GithubIntegration>;\n gitlab: ScmIntegrationsGroup<GitLabIntegration>;\n gitea: ScmIntegrationsGroup<GiteaIntegration>;\n googleGcs: ScmIntegrationsGroup<GoogleGcsIntegration>;\n harness: ScmIntegrationsGroup<HarnessIntegration>;\n}\n\n/**\n * Exposes the set of supported integrations.\n *\n * @public\n */\nexport class ScmIntegrations implements ScmIntegrationRegistry {\n private readonly byType: IntegrationsByType;\n\n static fromConfig(config: Config): ScmIntegrations {\n return new ScmIntegrations({\n awsS3: AwsS3Integration.factory({ config }),\n awsCodeCommit: AwsCodeCommitIntegration.factory({ config }),\n azureBlobStorage: AzureBlobStorageIntergation.factory({ config }),\n azure: AzureIntegration.factory({ config }),\n bitbucket: BitbucketIntegration.factory({ config }),\n bitbucketCloud: BitbucketCloudIntegration.factory({ config }),\n bitbucketServer: BitbucketServerIntegration.factory({ config }),\n gerrit: GerritIntegration.factory({ config }),\n github: GithubIntegration.factory({ config }),\n gitlab: GitLabIntegration.factory({ config }),\n gitea: GiteaIntegration.factory({ config }),\n googleGcs: GoogleGcsIntegration.factory({ config }),\n harness: HarnessIntegration.factory({ config }),\n });\n }\n\n constructor(integrationsByType: IntegrationsByType) {\n this.byType = integrationsByType;\n }\n\n get awsS3(): ScmIntegrationsGroup<AwsS3Integration> {\n return this.byType.awsS3;\n }\n\n get awsCodeCommit(): ScmIntegrationsGroup<AwsCodeCommitIntegration> {\n return this.byType.awsCodeCommit;\n }\n\n get azureBlobStorage(): ScmIntegrationsGroup<AzureBlobStorageIntergation> {\n return this.byType.azureBlobStorage;\n }\n\n get azure(): ScmIntegrationsGroup<AzureIntegration> {\n return this.byType.azure;\n }\n\n /**\n * @deprecated in favor of `bitbucketCloud()` and `bitbucketServer()`\n */\n get bitbucket(): ScmIntegrationsGroup<BitbucketIntegration> {\n return this.byType.bitbucket;\n }\n\n get bitbucketCloud(): ScmIntegrationsGroup<BitbucketCloudIntegration> {\n return this.byType.bitbucketCloud;\n }\n\n get bitbucketServer(): ScmIntegrationsGroup<BitbucketServerIntegration> {\n return this.byType.bitbucketServer;\n }\n\n get gerrit(): ScmIntegrationsGroup<GerritIntegration> {\n return this.byType.gerrit;\n }\n\n get github(): ScmIntegrationsGroup<GithubIntegration> {\n return this.byType.github;\n }\n\n get gitlab(): ScmIntegrationsGroup<GitLabIntegration> {\n return this.byType.gitlab;\n }\n\n get gitea(): ScmIntegrationsGroup<GiteaIntegration> {\n return this.byType.gitea;\n }\n\n get googleGcs(): ScmIntegrationsGroup<GoogleGcsIntegration> {\n return this.byType.googleGcs;\n }\n\n get harness(): ScmIntegrationsGroup<HarnessIntegration> {\n return this.byType.harness;\n }\n\n list(): ScmIntegration[] {\n return Object.values(this.byType).flatMap(\n i => i.list() as ScmIntegration[],\n );\n }\n\n byUrl(url: string | URL): ScmIntegration | undefined {\n let candidates = Object.values(this.byType)\n .map(i => i.byUrl(url))\n .filter(Boolean);\n\n // Do not return deprecated integrations if there are other options\n if (candidates.length > 1) {\n const filteredCandidates = candidates.filter(\n x => !(x instanceof BitbucketIntegration),\n );\n if (filteredCandidates.length !== 0) {\n candidates = filteredCandidates;\n }\n }\n\n return candidates[0];\n }\n\n byHost(host: string): ScmIntegration | undefined {\n return Object.values(this.byType)\n .map(i => i.byHost(host))\n .find(Boolean);\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n const integration = this.byUrl(options.base);\n if (!integration) {\n return defaultScmResolveUrl(options);\n }\n\n return integration.resolveUrl(options);\n }\n\n resolveEditUrl(url: string): string {\n const integration = this.byUrl(url);\n if (!integration) {\n return url;\n }\n\n return integration.resolveEditUrl(url);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+DO,MAAM,eAAA,CAAkD;AAAA,EAC5C,MAAA;AAAA,EAEjB,OAAO,WAAW,MAAA,EAAiC;AACjD,IAAA,OAAO,IAAI,eAAA,CAAgB;AAAA,MACzB,KAAA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edit)\//,
|
|
43
43
|
(_, host, owner, repo) => {
|
|
44
|
-
return `//${host
|
|
45
|
-
"en-US"
|
|
46
|
-
)}/${repo.toLocaleLowerCase("en-US")}/${type}/`;
|
|
44
|
+
return `//${host}/${owner}/${repo}/${type}/`;
|
|
47
45
|
}
|
|
48
46
|
);
|
|
49
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GithubIntegration.cjs.js","sources":["../../src/github/GithubIntegration.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 { basicIntegrations, defaultScmResolveUrl } from '../helpers';\nimport {\n RateLimitInfo,\n ScmIntegration,\n ScmIntegrationsFactory,\n} from '../types';\nimport {\n GithubIntegrationConfig,\n readGithubIntegrationConfigs,\n} from './config';\nimport { ConsumedResponse } from '@backstage/errors';\n\n/**\n * A GitHub based integration.\n *\n * @public\n */\nexport class GithubIntegration implements ScmIntegration {\n static factory: ScmIntegrationsFactory<GithubIntegration> = ({ config }) => {\n const configs = readGithubIntegrationConfigs(\n config.getOptionalConfigArray('integrations.github') ?? [],\n );\n return basicIntegrations(\n configs.map(c => new GithubIntegration(c)),\n i => i.config.host,\n );\n };\n\n constructor(private readonly integrationConfig: GithubIntegrationConfig) {}\n\n get type(): string {\n return 'github';\n }\n\n get title(): string {\n return this.integrationConfig.host;\n }\n\n get config(): GithubIntegrationConfig {\n return this.integrationConfig;\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n // GitHub uses blob URLs for files and tree urls for directory listings. But\n // there is a redirect from tree to blob for files, so we can always return\n // tree urls here.\n return replaceGithubUrlType(defaultScmResolveUrl(options), 'tree');\n }\n\n resolveEditUrl(url: string): string {\n return replaceGithubUrlType(url, 'edit');\n }\n\n parseRateLimitInfo(response: ConsumedResponse): RateLimitInfo {\n return {\n isRateLimited:\n response.status === 429 ||\n (response.status === 403 &&\n response.headers.get('x-ratelimit-remaining') === '0'),\n };\n }\n}\n\n/**\n * Takes a GitHub URL and replaces the type part (blob, tree etc).\n *\n * @param url - The original URL\n * @param type - The desired type, e.g. \"blob\"\n * @public\n */\nexport function replaceGithubUrlType(\n url: string,\n type: 'blob' | 'tree' | 'edit',\n): string {\n return url.replace(\n /\\/\\/([^/]+)\\/([^/]+)\\/([^/]+)\\/(blob|tree|edit)\\//,\n (_, host, owner, repo) => {\n return `//${host
|
|
1
|
+
{"version":3,"file":"GithubIntegration.cjs.js","sources":["../../src/github/GithubIntegration.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 { basicIntegrations, defaultScmResolveUrl } from '../helpers';\nimport {\n RateLimitInfo,\n ScmIntegration,\n ScmIntegrationsFactory,\n} from '../types';\nimport {\n GithubIntegrationConfig,\n readGithubIntegrationConfigs,\n} from './config';\nimport { ConsumedResponse } from '@backstage/errors';\n\n/**\n * A GitHub based integration.\n *\n * @public\n */\nexport class GithubIntegration implements ScmIntegration {\n static factory: ScmIntegrationsFactory<GithubIntegration> = ({ config }) => {\n const configs = readGithubIntegrationConfigs(\n config.getOptionalConfigArray('integrations.github') ?? [],\n );\n return basicIntegrations(\n configs.map(c => new GithubIntegration(c)),\n i => i.config.host,\n );\n };\n\n constructor(private readonly integrationConfig: GithubIntegrationConfig) {}\n\n get type(): string {\n return 'github';\n }\n\n get title(): string {\n return this.integrationConfig.host;\n }\n\n get config(): GithubIntegrationConfig {\n return this.integrationConfig;\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n // GitHub uses blob URLs for files and tree urls for directory listings. But\n // there is a redirect from tree to blob for files, so we can always return\n // tree urls here.\n return replaceGithubUrlType(defaultScmResolveUrl(options), 'tree');\n }\n\n resolveEditUrl(url: string): string {\n return replaceGithubUrlType(url, 'edit');\n }\n\n parseRateLimitInfo(response: ConsumedResponse): RateLimitInfo {\n return {\n isRateLimited:\n response.status === 429 ||\n (response.status === 403 &&\n response.headers.get('x-ratelimit-remaining') === '0'),\n };\n }\n}\n\n/**\n * Takes a GitHub URL and replaces the type part (blob, tree etc).\n *\n * @param url - The original URL\n * @param type - The desired type, e.g. \"blob\"\n * @public\n */\nexport function replaceGithubUrlType(\n url: string,\n type: 'blob' | 'tree' | 'edit',\n): string {\n return url.replace(\n /\\/\\/([^/]+)\\/([^/]+)\\/([^/]+)\\/(blob|tree|edit)\\//,\n (_, host, owner, repo) => {\n return `//${host}/${owner}/${repo}/${type}/`;\n },\n );\n}\n"],"names":["config","readGithubIntegrationConfigs","basicIntegrations","defaultScmResolveUrl"],"mappings":";;;;;AAiCO,MAAM,iBAAA,CAA4C;AAAA,EAWvD,YAA6B,iBAAA,EAA4C;AAA5C,IAAA,IAAA,CAAA,iBAAA,GAAA,iBAAA;AAAA,EAA6C;AAAA,EAV1E,OAAO,OAAA,GAAqD,CAAC,UAAEA,UAAO,KAAM;AAC1E,IAAA,MAAM,OAAA,GAAUC,mCAAA;AAAA,MACdD,QAAA,CAAO,sBAAA,CAAuB,qBAAqB,CAAA,IAAK;AAAC,KAC3D;AACA,IAAA,OAAOE,yBAAA;AAAA,MACL,QAAQ,GAAA,CAAI,CAAA,CAAA,KAAK,IAAI,i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|
(_, host, owner, repo) => {
|
|
42
|
-
return `//${host
|
|
43
|
-
"en-US"
|
|
44
|
-
)}/${repo.toLocaleLowerCase("en-US")}/${type}/`;
|
|
42
|
+
return `//${host}/${owner}/${repo}/${type}/`;
|
|
45
43
|
}
|
|
46
44
|
);
|
|
47
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GithubIntegration.esm.js","sources":["../../src/github/GithubIntegration.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 { basicIntegrations, defaultScmResolveUrl } from '../helpers';\nimport {\n RateLimitInfo,\n ScmIntegration,\n ScmIntegrationsFactory,\n} from '../types';\nimport {\n GithubIntegrationConfig,\n readGithubIntegrationConfigs,\n} from './config';\nimport { ConsumedResponse } from '@backstage/errors';\n\n/**\n * A GitHub based integration.\n *\n * @public\n */\nexport class GithubIntegration implements ScmIntegration {\n static factory: ScmIntegrationsFactory<GithubIntegration> = ({ config }) => {\n const configs = readGithubIntegrationConfigs(\n config.getOptionalConfigArray('integrations.github') ?? [],\n );\n return basicIntegrations(\n configs.map(c => new GithubIntegration(c)),\n i => i.config.host,\n );\n };\n\n constructor(private readonly integrationConfig: GithubIntegrationConfig) {}\n\n get type(): string {\n return 'github';\n }\n\n get title(): string {\n return this.integrationConfig.host;\n }\n\n get config(): GithubIntegrationConfig {\n return this.integrationConfig;\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n // GitHub uses blob URLs for files and tree urls for directory listings. But\n // there is a redirect from tree to blob for files, so we can always return\n // tree urls here.\n return replaceGithubUrlType(defaultScmResolveUrl(options), 'tree');\n }\n\n resolveEditUrl(url: string): string {\n return replaceGithubUrlType(url, 'edit');\n }\n\n parseRateLimitInfo(response: ConsumedResponse): RateLimitInfo {\n return {\n isRateLimited:\n response.status === 429 ||\n (response.status === 403 &&\n response.headers.get('x-ratelimit-remaining') === '0'),\n };\n }\n}\n\n/**\n * Takes a GitHub URL and replaces the type part (blob, tree etc).\n *\n * @param url - The original URL\n * @param type - The desired type, e.g. \"blob\"\n * @public\n */\nexport function replaceGithubUrlType(\n url: string,\n type: 'blob' | 'tree' | 'edit',\n): string {\n return url.replace(\n /\\/\\/([^/]+)\\/([^/]+)\\/([^/]+)\\/(blob|tree|edit)\\//,\n (_, host, owner, repo) => {\n return `//${host
|
|
1
|
+
{"version":3,"file":"GithubIntegration.esm.js","sources":["../../src/github/GithubIntegration.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 { basicIntegrations, defaultScmResolveUrl } from '../helpers';\nimport {\n RateLimitInfo,\n ScmIntegration,\n ScmIntegrationsFactory,\n} from '../types';\nimport {\n GithubIntegrationConfig,\n readGithubIntegrationConfigs,\n} from './config';\nimport { ConsumedResponse } from '@backstage/errors';\n\n/**\n * A GitHub based integration.\n *\n * @public\n */\nexport class GithubIntegration implements ScmIntegration {\n static factory: ScmIntegrationsFactory<GithubIntegration> = ({ config }) => {\n const configs = readGithubIntegrationConfigs(\n config.getOptionalConfigArray('integrations.github') ?? [],\n );\n return basicIntegrations(\n configs.map(c => new GithubIntegration(c)),\n i => i.config.host,\n );\n };\n\n constructor(private readonly integrationConfig: GithubIntegrationConfig) {}\n\n get type(): string {\n return 'github';\n }\n\n get title(): string {\n return this.integrationConfig.host;\n }\n\n get config(): GithubIntegrationConfig {\n return this.integrationConfig;\n }\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number;\n }): string {\n // GitHub uses blob URLs for files and tree urls for directory listings. But\n // there is a redirect from tree to blob for files, so we can always return\n // tree urls here.\n return replaceGithubUrlType(defaultScmResolveUrl(options), 'tree');\n }\n\n resolveEditUrl(url: string): string {\n return replaceGithubUrlType(url, 'edit');\n }\n\n parseRateLimitInfo(response: ConsumedResponse): RateLimitInfo {\n return {\n isRateLimited:\n response.status === 429 ||\n (response.status === 403 &&\n response.headers.get('x-ratelimit-remaining') === '0'),\n };\n }\n}\n\n/**\n * Takes a GitHub URL and replaces the type part (blob, tree etc).\n *\n * @param url - The original URL\n * @param type - The desired type, e.g. \"blob\"\n * @public\n */\nexport function replaceGithubUrlType(\n url: string,\n type: 'blob' | 'tree' | 'edit',\n): string {\n return url.replace(\n /\\/\\/([^/]+)\\/([^/]+)\\/([^/]+)\\/(blob|tree|edit)\\//,\n (_, host, owner, repo) => {\n return `//${host}/${owner}/${repo}/${type}/`;\n },\n );\n}\n"],"names":[],"mappings":";;;AAiCO,MAAM,iBAAA,CAA4C;AAAA,EAWvD,YAA6B,iBAAA,EAA4C;AAA5C,IAAA,IAAA,CAAA,iBAAA,GAAA,iBAAA;AAAA,EAA6C;AAAA,EAV1E,OAAO,OAAA,GAAqD,CAAC,EAAE,QAAO,KAAM;AAC1E,IAAA,MAAM,OAAA,GAAU,4BAAA;AAAA,MACd,MAAA,CAAO,sBAAA,CAAuB,qBAAqB,CAAA,IAAK;AAAC,KAC3D;AACA,IAAA,OAAO,iBAAA;AAAA,MACL,QAAQ,GAAA,CAAI,CAAA,CAAA,KAAK,IAAI,iBAAA,CAAkB,CAAC,CAAC,CAAA;AAAA,MACzC,CAAA,CAAA,KAAK,EAAE,MAAA,CAAO;AAAA,KAChB;AAAA,EACF,CAAA;AAAA,EAIA,IAAI,IAAA,GAAe;AACjB,IAAA,OAAO,QAAA;AAAA,EACT;AAAA,EAEA,IAAI,KAAA,GAAgB;AAClB,IAAA,OAAO,KAAK,iBAAA,CAAkB,IAAA;AAAA,EAChC;AAAA,EAEA,IAAI,MAAA,GAAkC;AACpC,IAAA,OAAO,IAAA,CAAK,iBAAA;AAAA,EACd;AAAA,EAEA,WAAW,OAAA,EAIA;AAIT,IAAA,OAAO,oBAAA,CAAqB,oBAAA,CAAqB,OAAO,CAAA,EAAG,MAAM,CAAA;AAAA,EACnE;AAAA,EAEA,eAAe,GAAA,EAAqB;AAClC,IAAA,OAAO,oBAAA,CAAqB,KAAK,MAAM,CAAA;AAAA,EACzC;AAAA,EAEA,mBAAmB,QAAA,EAA2C;AAC5D,IAAA,OAAO;AAAA,MACL,aAAA,EACE,QAAA,CAAS,MAAA,KAAW,GAAA,IACnB,QAAA,CAAS,MAAA,KAAW,GAAA,IACnB,QAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,uBAAuB,CAAA,KAAM;AAAA,KACxD;AAAA,EACF;AACF;AASO,SAAS,oBAAA,CACd,KACA,IAAA,EACQ;AACR,EAAA,OAAO,GAAA,CAAI,OAAA;AAAA,IACT,mDAAA;AAAA,IACA,CAAC,CAAA,EAAG,IAAA,EAAM,KAAA,EAAO,IAAA,KAAS;AACxB,MAAA,OAAO,KAAK,IAAI,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,IAAI,IAAI,IAAI,CAAA,CAAA,CAAA;AAAA,IAC3C;AAAA,GACF;AACF;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var helpers = require('../helpers.cjs.js');
|
|
4
|
+
var config = require('./config.cjs.js');
|
|
5
|
+
|
|
6
|
+
class GoogleGcsIntegration {
|
|
7
|
+
constructor(integrationConfig) {
|
|
8
|
+
this.integrationConfig = integrationConfig;
|
|
9
|
+
}
|
|
10
|
+
static factory = ({
|
|
11
|
+
config: config$1
|
|
12
|
+
}) => {
|
|
13
|
+
const gcsConfig = config$1.has("integrations.googleGcs") ? config.readGoogleGcsIntegrationConfig(
|
|
14
|
+
config$1.getConfig("integrations.googleGcs")
|
|
15
|
+
) : { host: config.GOOGLE_GCS_HOST };
|
|
16
|
+
return helpers.basicIntegrations(
|
|
17
|
+
[new GoogleGcsIntegration(gcsConfig)],
|
|
18
|
+
(i) => i.config.host
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
get type() {
|
|
22
|
+
return "googleGcs";
|
|
23
|
+
}
|
|
24
|
+
get title() {
|
|
25
|
+
return this.integrationConfig.host;
|
|
26
|
+
}
|
|
27
|
+
get config() {
|
|
28
|
+
return this.integrationConfig;
|
|
29
|
+
}
|
|
30
|
+
resolveUrl(options) {
|
|
31
|
+
return helpers.defaultScmResolveUrl(options);
|
|
32
|
+
}
|
|
33
|
+
resolveEditUrl(url) {
|
|
34
|
+
return url;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports.GoogleGcsIntegration = GoogleGcsIntegration;
|
|
39
|
+
//# sourceMappingURL=GoogleGcsIntegration.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleGcsIntegration.cjs.js","sources":["../../src/googleGcs/GoogleGcsIntegration.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 { basicIntegrations, defaultScmResolveUrl } from '../helpers';\nimport { ScmIntegration, ScmIntegrationsFactory } from '../types';\nimport {\n GoogleGcsIntegrationConfig,\n readGoogleGcsIntegrationConfig,\n GOOGLE_GCS_HOST,\n} from './config';\n\n/**\n * A Google Cloud Storage based integration.\n *\n * @public\n */\nexport class GoogleGcsIntegration implements ScmIntegration {\n static factory: ScmIntegrationsFactory<GoogleGcsIntegration> = ({\n config,\n }) => {\n const gcsConfig = config.has('integrations.googleGcs')\n ? readGoogleGcsIntegrationConfig(\n config.getConfig('integrations.googleGcs'),\n )\n : { host: GOOGLE_GCS_HOST };\n\n return basicIntegrations(\n [new GoogleGcsIntegration(gcsConfig)],\n i => i.config.host,\n );\n };\n\n get type(): string {\n return 'googleGcs';\n }\n\n get title(): string {\n return this.integrationConfig.host;\n }\n\n get config(): GoogleGcsIntegrationConfig {\n return this.integrationConfig;\n }\n\n constructor(private readonly integrationConfig: GoogleGcsIntegrationConfig) {}\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number | undefined;\n }): string {\n return defaultScmResolveUrl(options);\n }\n\n resolveEditUrl(url: string): string {\n return url;\n }\n}\n"],"names":["config","readGoogleGcsIntegrationConfig","GOOGLE_GCS_HOST","basicIntegrations","defaultScmResolveUrl"],"mappings":";;;;;AA6BO,MAAM,oBAAA,CAA+C;AAAA,EA4B1D,YAA6B,iBAAA,EAA+C;AAA/C,IAAA,IAAA,CAAA,iBAAA,GAAA,iBAAA;AAAA,EAAgD;AAAA,EA3B7E,OAAO,UAAwD,CAAC;AAAA,YAC9DA;AAAA,GACF,KAAM;AACJ,IAAA,MAAM,SAAA,GAAYA,QAAA,CAAO,GAAA,CAAI,wBAAwB,CAAA,GACjDC,qCAAA;AAAA,MACED,QAAA,CAAO,UAAU,wBAAwB;AAAA,KAC3C,GACA,EAAE,IAAA,EAAME,sBAAA,EAAgB;AAE5B,IAAA,OAAOC,yBAAA;AAAA,MACL,CAAC,IAAI,oBAAA,CAAqB,SAAS,CAAC,CAAA;AAAA,MACpC,CAAA,CAAA,KAAK,EAAE,MAAA,CAAO;AAAA,KAChB;AAAA,EACF,CAAA;AAAA,EAEA,IAAI,IAAA,GAAe;AACjB,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EAEA,IAAI,KAAA,GAAgB;AAClB,IAAA,OAAO,KAAK,iBAAA,CAAkB,IAAA;AAAA,EAChC;AAAA,EAEA,IAAI,MAAA,GAAqC;AACvC,IAAA,OAAO,IAAA,CAAK,iBAAA;AAAA,EACd;AAAA,EAIA,WAAW,OAAA,EAIA;AACT,IAAA,OAAOC,6BAAqB,OAAO,CAAA;AAAA,EACrC;AAAA,EAEA,eAAe,GAAA,EAAqB;AAClC,IAAA,OAAO,GAAA;AAAA,EACT;AACF;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { basicIntegrations, defaultScmResolveUrl } from '../helpers.esm.js';
|
|
2
|
+
import { readGoogleGcsIntegrationConfig, GOOGLE_GCS_HOST } from './config.esm.js';
|
|
3
|
+
|
|
4
|
+
class GoogleGcsIntegration {
|
|
5
|
+
constructor(integrationConfig) {
|
|
6
|
+
this.integrationConfig = integrationConfig;
|
|
7
|
+
}
|
|
8
|
+
static factory = ({
|
|
9
|
+
config
|
|
10
|
+
}) => {
|
|
11
|
+
const gcsConfig = config.has("integrations.googleGcs") ? readGoogleGcsIntegrationConfig(
|
|
12
|
+
config.getConfig("integrations.googleGcs")
|
|
13
|
+
) : { host: GOOGLE_GCS_HOST };
|
|
14
|
+
return basicIntegrations(
|
|
15
|
+
[new GoogleGcsIntegration(gcsConfig)],
|
|
16
|
+
(i) => i.config.host
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
get type() {
|
|
20
|
+
return "googleGcs";
|
|
21
|
+
}
|
|
22
|
+
get title() {
|
|
23
|
+
return this.integrationConfig.host;
|
|
24
|
+
}
|
|
25
|
+
get config() {
|
|
26
|
+
return this.integrationConfig;
|
|
27
|
+
}
|
|
28
|
+
resolveUrl(options) {
|
|
29
|
+
return defaultScmResolveUrl(options);
|
|
30
|
+
}
|
|
31
|
+
resolveEditUrl(url) {
|
|
32
|
+
return url;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { GoogleGcsIntegration };
|
|
37
|
+
//# sourceMappingURL=GoogleGcsIntegration.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleGcsIntegration.esm.js","sources":["../../src/googleGcs/GoogleGcsIntegration.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 { basicIntegrations, defaultScmResolveUrl } from '../helpers';\nimport { ScmIntegration, ScmIntegrationsFactory } from '../types';\nimport {\n GoogleGcsIntegrationConfig,\n readGoogleGcsIntegrationConfig,\n GOOGLE_GCS_HOST,\n} from './config';\n\n/**\n * A Google Cloud Storage based integration.\n *\n * @public\n */\nexport class GoogleGcsIntegration implements ScmIntegration {\n static factory: ScmIntegrationsFactory<GoogleGcsIntegration> = ({\n config,\n }) => {\n const gcsConfig = config.has('integrations.googleGcs')\n ? readGoogleGcsIntegrationConfig(\n config.getConfig('integrations.googleGcs'),\n )\n : { host: GOOGLE_GCS_HOST };\n\n return basicIntegrations(\n [new GoogleGcsIntegration(gcsConfig)],\n i => i.config.host,\n );\n };\n\n get type(): string {\n return 'googleGcs';\n }\n\n get title(): string {\n return this.integrationConfig.host;\n }\n\n get config(): GoogleGcsIntegrationConfig {\n return this.integrationConfig;\n }\n\n constructor(private readonly integrationConfig: GoogleGcsIntegrationConfig) {}\n\n resolveUrl(options: {\n url: string;\n base: string;\n lineNumber?: number | undefined;\n }): string {\n return defaultScmResolveUrl(options);\n }\n\n resolveEditUrl(url: string): string {\n return url;\n }\n}\n"],"names":[],"mappings":";;;AA6BO,MAAM,oBAAA,CAA+C;AAAA,EA4B1D,YAA6B,iBAAA,EAA+C;AAA/C,IAAA,IAAA,CAAA,iBAAA,GAAA,iBAAA;AAAA,EAAgD;AAAA,EA3B7E,OAAO,UAAwD,CAAC;AAAA,IAC9D;AAAA,GACF,KAAM;AACJ,IAAA,MAAM,SAAA,GAAY,MAAA,CAAO,GAAA,CAAI,wBAAwB,CAAA,GACjD,8BAAA;AAAA,MACE,MAAA,CAAO,UAAU,wBAAwB;AAAA,KAC3C,GACA,EAAE,IAAA,EAAM,eAAA,EAAgB;AAE5B,IAAA,OAAO,iBAAA;AAAA,MACL,CAAC,IAAI,oBAAA,CAAqB,SAAS,CAAC,CAAA;AAAA,MACpC,CAAA,CAAA,KAAK,EAAE,MAAA,CAAO;AAAA,KAChB;AAAA,EACF,CAAA;AAAA,EAEA,IAAI,IAAA,GAAe;AACjB,IAAA,OAAO,WAAA;AAAA,EACT;AAAA,EAEA,IAAI,KAAA,GAAgB;AAClB,IAAA,OAAO,KAAK,iBAAA,CAAkB,IAAA;AAAA,EAChC;AAAA,EAEA,IAAI,MAAA,GAAqC;AACvC,IAAA,OAAO,IAAA,CAAK,iBAAA;AAAA,EACd;AAAA,EAIA,WAAW,OAAA,EAIA;AACT,IAAA,OAAO,qBAAqB,OAAO,CAAA;AAAA,EACrC;AAAA,EAEA,eAAe,GAAA,EAAqB;AAClC,IAAA,OAAO,GAAA;AAAA,EACT;AACF;;;;"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const GOOGLE_GCS_HOST = "storage.cloud.google.com";
|
|
3
4
|
function readGoogleGcsIntegrationConfig(config) {
|
|
4
5
|
if (!config) {
|
|
5
|
-
return {};
|
|
6
|
+
return { host: GOOGLE_GCS_HOST };
|
|
6
7
|
}
|
|
7
8
|
if (!config.has("clientEmail") && !config.has("privateKey")) {
|
|
8
|
-
return {};
|
|
9
|
+
return { host: GOOGLE_GCS_HOST };
|
|
9
10
|
}
|
|
10
11
|
const privateKey = config.getString("privateKey").split("\\n").join("\n");
|
|
11
12
|
const clientEmail = config.getString("clientEmail");
|
|
12
|
-
return {
|
|
13
|
+
return {
|
|
14
|
+
host: GOOGLE_GCS_HOST,
|
|
15
|
+
clientEmail,
|
|
16
|
+
privateKey
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
19
|
|
|
20
|
+
exports.GOOGLE_GCS_HOST = GOOGLE_GCS_HOST;
|
|
15
21
|
exports.readGoogleGcsIntegrationConfig = readGoogleGcsIntegrationConfig;
|
|
16
22
|
//# sourceMappingURL=config.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs.js","sources":["../../src/googleGcs/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\n/**\n * The configuration parameters for a single Google Cloud Storage provider.\n *\n * @public\n */\nexport type GoogleGcsIntegrationConfig = {\n /**\n * Service account email used to authenticate requests.\n */\n clientEmail?: string;\n /**\n * Service account private key used to authenticate requests.\n */\n privateKey?: string;\n};\n\n/**\n * Reads a single Google GCS integration config.\n *\n * @param config - The config object of a single integration\n * @public\n */\nexport function readGoogleGcsIntegrationConfig(\n config: Config,\n): GoogleGcsIntegrationConfig {\n if (!config) {\n return {};\n }\n\n if (!config.has('clientEmail') && !config.has('privateKey')) {\n return {};\n }\n\n const privateKey = config.getString('privateKey').split('\\\\n').join('\\n');\n
|
|
1
|
+
{"version":3,"file":"config.cjs.js","sources":["../../src/googleGcs/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\n/**\n * The default Google Cloud Storage host.\n *\n */\nexport const GOOGLE_GCS_HOST = 'storage.cloud.google.com';\n\n/**\n * The configuration parameters for a single Google Cloud Storage provider.\n *\n * @public\n */\nexport type GoogleGcsIntegrationConfig = {\n /**\n * The host of the target that this matches on.\n */\n host: string;\n /**\n * Service account email used to authenticate requests.\n */\n clientEmail?: string;\n /**\n * Service account private key used to authenticate requests.\n */\n privateKey?: string;\n};\n\n/**\n * Reads a single Google GCS integration config.\n *\n * @param config - The config object of a single integration\n * @public\n */\nexport function readGoogleGcsIntegrationConfig(\n config: Config,\n): GoogleGcsIntegrationConfig {\n if (!config) {\n return { host: GOOGLE_GCS_HOST };\n }\n\n if (!config.has('clientEmail') && !config.has('privateKey')) {\n return { host: GOOGLE_GCS_HOST };\n }\n\n const privateKey = config.getString('privateKey').split('\\\\n').join('\\n');\n const clientEmail = config.getString('clientEmail');\n\n return {\n host: GOOGLE_GCS_HOST,\n clientEmail,\n privateKey,\n };\n}\n"],"names":[],"mappings":";;AAsBO,MAAM,eAAA,GAAkB;AA4BxB,SAAS,+BACd,MAAA,EAC4B;AAC5B,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,EAAE,MAAM,eAAA,EAAgB;AAAA,EACjC;AAEA,EAAA,IAAI,CAAC,OAAO,GAAA,CAAI,aAAa,KAAK,CAAC,MAAA,CAAO,GAAA,CAAI,YAAY,CAAA,EAAG;AAC3D,IAAA,OAAO,EAAE,MAAM,eAAA,EAAgB;AAAA,EACjC;AAEA,EAAA,MAAM,UAAA,GAAa,OAAO,SAAA,CAAU,YAAY,EAAE,KAAA,CAAM,KAAK,CAAA,CAAE,IAAA,CAAK,IAAI,CAAA;AACxE,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,SAAA,CAAU,aAAa,CAAA;AAElD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;;"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
const GOOGLE_GCS_HOST = "storage.cloud.google.com";
|
|
1
2
|
function readGoogleGcsIntegrationConfig(config) {
|
|
2
3
|
if (!config) {
|
|
3
|
-
return {};
|
|
4
|
+
return { host: GOOGLE_GCS_HOST };
|
|
4
5
|
}
|
|
5
6
|
if (!config.has("clientEmail") && !config.has("privateKey")) {
|
|
6
|
-
return {};
|
|
7
|
+
return { host: GOOGLE_GCS_HOST };
|
|
7
8
|
}
|
|
8
9
|
const privateKey = config.getString("privateKey").split("\\n").join("\n");
|
|
9
10
|
const clientEmail = config.getString("clientEmail");
|
|
10
|
-
return {
|
|
11
|
+
return {
|
|
12
|
+
host: GOOGLE_GCS_HOST,
|
|
13
|
+
clientEmail,
|
|
14
|
+
privateKey
|
|
15
|
+
};
|
|
11
16
|
}
|
|
12
17
|
|
|
13
|
-
export { readGoogleGcsIntegrationConfig };
|
|
18
|
+
export { GOOGLE_GCS_HOST, readGoogleGcsIntegrationConfig };
|
|
14
19
|
//# sourceMappingURL=config.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.esm.js","sources":["../../src/googleGcs/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\n/**\n * The configuration parameters for a single Google Cloud Storage provider.\n *\n * @public\n */\nexport type GoogleGcsIntegrationConfig = {\n /**\n * Service account email used to authenticate requests.\n */\n clientEmail?: string;\n /**\n * Service account private key used to authenticate requests.\n */\n privateKey?: string;\n};\n\n/**\n * Reads a single Google GCS integration config.\n *\n * @param config - The config object of a single integration\n * @public\n */\nexport function readGoogleGcsIntegrationConfig(\n config: Config,\n): GoogleGcsIntegrationConfig {\n if (!config) {\n return {};\n }\n\n if (!config.has('clientEmail') && !config.has('privateKey')) {\n return {};\n }\n\n const privateKey = config.getString('privateKey').split('\\\\n').join('\\n');\n
|
|
1
|
+
{"version":3,"file":"config.esm.js","sources":["../../src/googleGcs/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\n/**\n * The default Google Cloud Storage host.\n *\n */\nexport const GOOGLE_GCS_HOST = 'storage.cloud.google.com';\n\n/**\n * The configuration parameters for a single Google Cloud Storage provider.\n *\n * @public\n */\nexport type GoogleGcsIntegrationConfig = {\n /**\n * The host of the target that this matches on.\n */\n host: string;\n /**\n * Service account email used to authenticate requests.\n */\n clientEmail?: string;\n /**\n * Service account private key used to authenticate requests.\n */\n privateKey?: string;\n};\n\n/**\n * Reads a single Google GCS integration config.\n *\n * @param config - The config object of a single integration\n * @public\n */\nexport function readGoogleGcsIntegrationConfig(\n config: Config,\n): GoogleGcsIntegrationConfig {\n if (!config) {\n return { host: GOOGLE_GCS_HOST };\n }\n\n if (!config.has('clientEmail') && !config.has('privateKey')) {\n return { host: GOOGLE_GCS_HOST };\n }\n\n const privateKey = config.getString('privateKey').split('\\\\n').join('\\n');\n const clientEmail = config.getString('clientEmail');\n\n return {\n host: GOOGLE_GCS_HOST,\n clientEmail,\n privateKey,\n };\n}\n"],"names":[],"mappings":"AAsBO,MAAM,eAAA,GAAkB;AA4BxB,SAAS,+BACd,MAAA,EAC4B;AAC5B,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,EAAE,MAAM,eAAA,EAAgB;AAAA,EACjC;AAEA,EAAA,IAAI,CAAC,OAAO,GAAA,CAAI,aAAa,KAAK,CAAC,MAAA,CAAO,GAAA,CAAI,YAAY,CAAA,EAAG;AAC3D,IAAA,OAAO,EAAE,MAAM,eAAA,EAAgB;AAAA,EACjC;AAEA,EAAA,MAAM,UAAA,GAAa,OAAO,SAAA,CAAU,YAAY,EAAE,KAAA,CAAM,KAAK,CAAA,CAAE,IAAA,CAAK,IAAI,CAAA;AACxE,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,SAAA,CAAU,aAAa,CAAA;AAElD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -37,6 +37,7 @@ var core$7 = require('./gitlab/core.cjs.js');
|
|
|
37
37
|
var GitLabIntegration = require('./gitlab/GitLabIntegration.cjs.js');
|
|
38
38
|
var DefaultGitlabCredentialsProvider = require('./gitlab/DefaultGitlabCredentialsProvider.cjs.js');
|
|
39
39
|
var config$b = require('./googleGcs/config.cjs.js');
|
|
40
|
+
var GoogleGcsIntegration = require('./googleGcs/GoogleGcsIntegration.cjs.js');
|
|
40
41
|
var HarnessIntegration = require('./harness/HarnessIntegration.cjs.js');
|
|
41
42
|
var core$8 = require('./harness/core.cjs.js');
|
|
42
43
|
var config$c = require('./harness/config.cjs.js');
|
|
@@ -125,6 +126,7 @@ exports.GitLabIntegration = GitLabIntegration.GitLabIntegration;
|
|
|
125
126
|
exports.replaceGitLabUrlType = GitLabIntegration.replaceGitLabUrlType;
|
|
126
127
|
exports.DefaultGitlabCredentialsProvider = DefaultGitlabCredentialsProvider.DefaultGitlabCredentialsProvider;
|
|
127
128
|
exports.readGoogleGcsIntegrationConfig = config$b.readGoogleGcsIntegrationConfig;
|
|
129
|
+
exports.GoogleGcsIntegration = GoogleGcsIntegration.GoogleGcsIntegration;
|
|
128
130
|
exports.HarnessIntegration = HarnessIntegration.HarnessIntegration;
|
|
129
131
|
exports.getHarnessArchiveUrl = core$8.getHarnessArchiveUrl;
|
|
130
132
|
exports.getHarnessFileContentsUrl = core$8.getHarnessFileContentsUrl;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1898,6 +1898,10 @@ declare class DefaultGitlabCredentialsProvider implements GitlabCredentialsProvi
|
|
|
1898
1898
|
* @public
|
|
1899
1899
|
*/
|
|
1900
1900
|
type GoogleGcsIntegrationConfig = {
|
|
1901
|
+
/**
|
|
1902
|
+
* The host of the target that this matches on.
|
|
1903
|
+
*/
|
|
1904
|
+
host: string;
|
|
1901
1905
|
/**
|
|
1902
1906
|
* Service account email used to authenticate requests.
|
|
1903
1907
|
*/
|
|
@@ -1915,6 +1919,26 @@ type GoogleGcsIntegrationConfig = {
|
|
|
1915
1919
|
*/
|
|
1916
1920
|
declare function readGoogleGcsIntegrationConfig(config: Config): GoogleGcsIntegrationConfig;
|
|
1917
1921
|
|
|
1922
|
+
/**
|
|
1923
|
+
* A Google Cloud Storage based integration.
|
|
1924
|
+
*
|
|
1925
|
+
* @public
|
|
1926
|
+
*/
|
|
1927
|
+
declare class GoogleGcsIntegration implements ScmIntegration {
|
|
1928
|
+
private readonly integrationConfig;
|
|
1929
|
+
static factory: ScmIntegrationsFactory<GoogleGcsIntegration>;
|
|
1930
|
+
get type(): string;
|
|
1931
|
+
get title(): string;
|
|
1932
|
+
get config(): GoogleGcsIntegrationConfig;
|
|
1933
|
+
constructor(integrationConfig: GoogleGcsIntegrationConfig);
|
|
1934
|
+
resolveUrl(options: {
|
|
1935
|
+
url: string;
|
|
1936
|
+
base: string;
|
|
1937
|
+
lineNumber?: number | undefined;
|
|
1938
|
+
}): string;
|
|
1939
|
+
resolveEditUrl(url: string): string;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1918
1942
|
/**
|
|
1919
1943
|
* Given a file path URL,
|
|
1920
1944
|
* it returns an API URL which returns the contents of the file .
|
|
@@ -2020,6 +2044,7 @@ interface IntegrationsByType {
|
|
|
2020
2044
|
github: ScmIntegrationsGroup<GithubIntegration>;
|
|
2021
2045
|
gitlab: ScmIntegrationsGroup<GitLabIntegration>;
|
|
2022
2046
|
gitea: ScmIntegrationsGroup<GiteaIntegration>;
|
|
2047
|
+
googleGcs: ScmIntegrationsGroup<GoogleGcsIntegration>;
|
|
2023
2048
|
harness: ScmIntegrationsGroup<HarnessIntegration>;
|
|
2024
2049
|
}
|
|
2025
2050
|
/**
|
|
@@ -2045,6 +2070,7 @@ declare class ScmIntegrations implements ScmIntegrationRegistry {
|
|
|
2045
2070
|
get github(): ScmIntegrationsGroup<GithubIntegration>;
|
|
2046
2071
|
get gitlab(): ScmIntegrationsGroup<GitLabIntegration>;
|
|
2047
2072
|
get gitea(): ScmIntegrationsGroup<GiteaIntegration>;
|
|
2073
|
+
get googleGcs(): ScmIntegrationsGroup<GoogleGcsIntegration>;
|
|
2048
2074
|
get harness(): ScmIntegrationsGroup<HarnessIntegration>;
|
|
2049
2075
|
list(): ScmIntegration[];
|
|
2050
2076
|
byUrl(url: string | URL): ScmIntegration | undefined;
|
|
@@ -2057,5 +2083,5 @@ declare class ScmIntegrations implements ScmIntegrationRegistry {
|
|
|
2057
2083
|
resolveEditUrl(url: string): string;
|
|
2058
2084
|
}
|
|
2059
2085
|
|
|
2060
|
-
export { AwsCodeCommitIntegration, AwsS3Integration, AzureBlobStorageIntergation, AzureIntegration, BitbucketCloudIntegration, BitbucketIntegration, BitbucketServerIntegration, DefaultAzureCredentialsManager, DefaultAzureDevOpsCredentialsProvider, DefaultGithubCredentialsProvider, DefaultGitlabCredentialsProvider, GerritIntegration, GitLabIntegration, GiteaIntegration, GithubAppCredentialsMux, GithubIntegration, HarnessIntegration, ScmIntegrations, SingleInstanceGithubCredentialsProvider, buildGerritGitilesArchiveUrl, buildGerritGitilesArchiveUrlFromLocation, defaultScmResolveUrl, getAzureCommitsUrl, getAzureDownloadUrl, getAzureFileFetchUrl, getAzureRequestOptions, getBitbucketCloudDefaultBranch, getBitbucketCloudDownloadUrl, getBitbucketCloudFileFetchUrl, getBitbucketCloudOAuthToken, getBitbucketCloudRequestOptions, getBitbucketDefaultBranch, getBitbucketDownloadUrl, getBitbucketFileFetchUrl, getBitbucketRequestOptions, getBitbucketServerDefaultBranch, getBitbucketServerDownloadUrl, getBitbucketServerFileFetchUrl, getBitbucketServerRequestOptions, getGerritBranchApiUrl, getGerritCloneRepoUrl, getGerritFileContentsApiUrl, getGerritProjectsApiUrl, getGerritRequestOptions, getGitHubRequestOptions, getGitLabFileFetchUrl, getGitLabIntegrationRelativePath, getGitLabRequestOptions, getGiteaArchiveUrl, getGiteaEditContentsUrl, getGiteaFileContentsUrl, getGiteaLatestCommitUrl, getGiteaRequestOptions, getGithubFileFetchUrl, getGitilesAuthenticationUrl, getHarnessArchiveUrl, getHarnessFileContentsUrl, getHarnessLatestCommitUrl, getHarnessRequestOptions, parseGerritGitilesUrl, parseGerritJsonResponse, parseGiteaUrl, parseGitilesUrlRef, parseHarnessUrl, readAwsCodeCommitIntegrationConfig, readAwsCodeCommitIntegrationConfigs, readAwsS3IntegrationConfig, readAwsS3IntegrationConfigs, readAzureBlobStorageIntegrationConfig, readAzureBlobStorageIntegrationConfigs, readAzureIntegrationConfig, readAzureIntegrationConfigs, readBitbucketCloudIntegrationConfig, readBitbucketCloudIntegrationConfigs, readBitbucketIntegrationConfig, readBitbucketIntegrationConfigs, readBitbucketServerIntegrationConfig, readBitbucketServerIntegrationConfigs, readGerritIntegrationConfig, readGerritIntegrationConfigs, readGitLabIntegrationConfig, readGitLabIntegrationConfigs, readGiteaConfig, readGithubIntegrationConfig, readGithubIntegrationConfigs, readGoogleGcsIntegrationConfig, readHarnessConfig, replaceGitLabUrlType, replaceGithubUrlType };
|
|
2086
|
+
export { AwsCodeCommitIntegration, AwsS3Integration, AzureBlobStorageIntergation, AzureIntegration, BitbucketCloudIntegration, BitbucketIntegration, BitbucketServerIntegration, DefaultAzureCredentialsManager, DefaultAzureDevOpsCredentialsProvider, DefaultGithubCredentialsProvider, DefaultGitlabCredentialsProvider, GerritIntegration, GitLabIntegration, GiteaIntegration, GithubAppCredentialsMux, GithubIntegration, GoogleGcsIntegration, HarnessIntegration, ScmIntegrations, SingleInstanceGithubCredentialsProvider, buildGerritGitilesArchiveUrl, buildGerritGitilesArchiveUrlFromLocation, defaultScmResolveUrl, getAzureCommitsUrl, getAzureDownloadUrl, getAzureFileFetchUrl, getAzureRequestOptions, getBitbucketCloudDefaultBranch, getBitbucketCloudDownloadUrl, getBitbucketCloudFileFetchUrl, getBitbucketCloudOAuthToken, getBitbucketCloudRequestOptions, getBitbucketDefaultBranch, getBitbucketDownloadUrl, getBitbucketFileFetchUrl, getBitbucketRequestOptions, getBitbucketServerDefaultBranch, getBitbucketServerDownloadUrl, getBitbucketServerFileFetchUrl, getBitbucketServerRequestOptions, getGerritBranchApiUrl, getGerritCloneRepoUrl, getGerritFileContentsApiUrl, getGerritProjectsApiUrl, getGerritRequestOptions, getGitHubRequestOptions, getGitLabFileFetchUrl, getGitLabIntegrationRelativePath, getGitLabRequestOptions, getGiteaArchiveUrl, getGiteaEditContentsUrl, getGiteaFileContentsUrl, getGiteaLatestCommitUrl, getGiteaRequestOptions, getGithubFileFetchUrl, getGitilesAuthenticationUrl, getHarnessArchiveUrl, getHarnessFileContentsUrl, getHarnessLatestCommitUrl, getHarnessRequestOptions, parseGerritGitilesUrl, parseGerritJsonResponse, parseGiteaUrl, parseGitilesUrlRef, parseHarnessUrl, readAwsCodeCommitIntegrationConfig, readAwsCodeCommitIntegrationConfigs, readAwsS3IntegrationConfig, readAwsS3IntegrationConfigs, readAzureBlobStorageIntegrationConfig, readAzureBlobStorageIntegrationConfigs, readAzureIntegrationConfig, readAzureIntegrationConfigs, readBitbucketCloudIntegrationConfig, readBitbucketCloudIntegrationConfigs, readBitbucketIntegrationConfig, readBitbucketIntegrationConfigs, readBitbucketServerIntegrationConfig, readBitbucketServerIntegrationConfigs, readGerritIntegrationConfig, readGerritIntegrationConfigs, readGitLabIntegrationConfig, readGitLabIntegrationConfigs, readGiteaConfig, readGithubIntegrationConfig, readGithubIntegrationConfigs, readGoogleGcsIntegrationConfig, readHarnessConfig, replaceGitLabUrlType, replaceGithubUrlType };
|
|
2061
2087
|
export type { AwsCodeCommitIntegrationConfig, AwsS3IntegrationConfig, AzureBlobStorageIntegrationConfig, AzureClientSecretCredential, AzureCredentialBase, AzureCredentialsManager, AzureDevOpsCredential, AzureDevOpsCredentialKind, AzureDevOpsCredentialLike, AzureDevOpsCredentialType, AzureDevOpsCredentials, AzureDevOpsCredentialsProvider, AzureIntegrationConfig, AzureManagedIdentityClientAssertionCredential, AzureManagedIdentityCredential, BitbucketCloudIntegrationConfig, BitbucketIntegrationConfig, BitbucketServerIntegrationConfig, GerritIntegrationConfig, GitLabIntegrationConfig, GiteaIntegrationConfig, GithubAppConfig, GithubCredentialType, GithubCredentials, GithubCredentialsProvider, GithubIntegrationConfig, GitlabCredentials, GitlabCredentialsProvider, GoogleGcsIntegrationConfig, HarnessIntegrationConfig, IntegrationsByType, PersonalAccessTokenCredential, RateLimitInfo, ScmIntegration, ScmIntegrationRegistry, ScmIntegrationsFactory, ScmIntegrationsGroup };
|
package/dist/index.esm.js
CHANGED
|
@@ -35,6 +35,7 @@ export { getGitLabFileFetchUrl, getGitLabRequestOptions } from './gitlab/core.es
|
|
|
35
35
|
export { GitLabIntegration, replaceGitLabUrlType } from './gitlab/GitLabIntegration.esm.js';
|
|
36
36
|
export { DefaultGitlabCredentialsProvider } from './gitlab/DefaultGitlabCredentialsProvider.esm.js';
|
|
37
37
|
export { readGoogleGcsIntegrationConfig } from './googleGcs/config.esm.js';
|
|
38
|
+
export { GoogleGcsIntegration } from './googleGcs/GoogleGcsIntegration.esm.js';
|
|
38
39
|
export { HarnessIntegration } from './harness/HarnessIntegration.esm.js';
|
|
39
40
|
export { getHarnessArchiveUrl, getHarnessFileContentsUrl, getHarnessLatestCommitUrl, getHarnessRequestOptions, parseHarnessUrl } from './harness/core.esm.js';
|
|
40
41
|
export { readHarnessConfig } from './harness/config.esm.js';
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/integration",
|
|
3
|
-
"version": "1.19.0",
|
|
3
|
+
"version": "1.19.2-next.0",
|
|
4
4
|
"description": "Helpers for managing integrations towards external systems",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "common-library"
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@azure/identity": "^4.0.0",
|
|
41
41
|
"@azure/storage-blob": "^12.5.0",
|
|
42
|
-
"@backstage/config": "
|
|
43
|
-
"@backstage/errors": "
|
|
42
|
+
"@backstage/config": "1.3.6",
|
|
43
|
+
"@backstage/errors": "1.2.7",
|
|
44
44
|
"@octokit/auth-app": "^4.0.0",
|
|
45
45
|
"@octokit/rest": "^19.0.3",
|
|
46
46
|
"cross-fetch": "^4.0.0",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"luxon": "^3.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@backstage/cli": "
|
|
53
|
-
"@backstage/config-loader": "
|
|
52
|
+
"@backstage/cli": "0.35.2-next.1",
|
|
53
|
+
"@backstage/config-loader": "1.10.7",
|
|
54
54
|
"msw": "^1.0.0"
|
|
55
55
|
},
|
|
56
56
|
"configSchema": "config.d.ts",
|