@backstage/integration
Version:
Helpers for managing integrations towards external systems
29 lines (27 loc) • 922 B
JavaScript
const BITBUCKET_CLOUD_HOST = "bitbucket.org";
const BITBUCKET_CLOUD_API_BASE_URL = "https://api.bitbucket.org/2.0";
function readBitbucketCloudIntegrationConfig(config) {
const host = BITBUCKET_CLOUD_HOST;
const apiBaseUrl = BITBUCKET_CLOUD_API_BASE_URL;
const username = config.getString("username");
const appPassword = config.getString("appPassword")?.trim();
return {
host,
apiBaseUrl,
username,
appPassword,
commitSigningKey: config.getOptionalString("commitSigningKey")
};
}
function readBitbucketCloudIntegrationConfigs(configs) {
const result = configs.map(readBitbucketCloudIntegrationConfig);
if (result.length === 0) {
result.push({
host: BITBUCKET_CLOUD_HOST,
apiBaseUrl: BITBUCKET_CLOUD_API_BASE_URL
});
}
return result;
}
export { readBitbucketCloudIntegrationConfig, readBitbucketCloudIntegrationConfigs };
//# sourceMappingURL=config.esm.js.map