@backstage/integration 1.7.2-next.0 → 1.8.0-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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @backstage/integration
2
2
 
3
+ ## 1.8.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 870db76a45: Implemented `readTree` for Gitea provider to support TechDocs functionality
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @backstage/config@1.1.1
13
+
14
+ ## 1.7.2
15
+
16
+ ### Patch Changes
17
+
18
+ - 243c655a68: JSDoc and Error message updates to handle `Azure Active Directory` re-brand to `Entra ID`
19
+ - 4aa43f62aa: Updated dependency `cross-fetch` to `^4.0.0`.
20
+ - Updated dependencies
21
+ - @backstage/config@1.1.1
22
+
3
23
  ## 1.7.2-next.0
4
24
 
5
25
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -1424,26 +1424,20 @@ function readGiteaConfig(config) {
1424
1424
  }
1425
1425
 
1426
1426
  function getGiteaEditContentsUrl(config, url) {
1427
- var _a;
1428
- try {
1429
- const baseUrl = (_a = config.baseUrl) != null ? _a : `https://${config.host}`;
1430
- const [_blank, owner, name, _src, _branch, ref, ...path] = url.replace(baseUrl, "").split("/");
1431
- const pathWithoutSlash = path.join("/").replace(/^\//, "");
1432
- return `${baseUrl}/${owner}/${name}/_edit/${ref}/${pathWithoutSlash}`;
1433
- } catch (e) {
1434
- throw new Error(`Incorrect URL: ${url}, ${e}`);
1435
- }
1427
+ const giteaUrl = parseGiteaUrl(config, url);
1428
+ return `${giteaUrl.url}/${giteaUrl.owner}/${giteaUrl.name}/_edit/${giteaUrl.ref}/${giteaUrl.path}`;
1436
1429
  }
1437
1430
  function getGiteaFileContentsUrl(config, url) {
1438
- var _a;
1439
- try {
1440
- const baseUrl = (_a = config.baseUrl) != null ? _a : `https://${config.host}`;
1441
- const [_blank, owner, name, _src, _branch, ref, ...path] = url.replace(baseUrl, "").split("/");
1442
- const pathWithoutSlash = path.join("/").replace(/^\//, "");
1443
- return `${baseUrl}/api/v1/repos/${owner}/${name}/contents/${pathWithoutSlash}?ref=${ref}`;
1444
- } catch (e) {
1445
- throw new Error(`Incorrect URL: ${url}, ${e}`);
1446
- }
1431
+ const giteaUrl = parseGiteaUrl(config, url);
1432
+ return `${giteaUrl.url}/api/v1/repos/${giteaUrl.owner}/${giteaUrl.name}/contents/${giteaUrl.path}?ref=${giteaUrl.ref}`;
1433
+ }
1434
+ function getGiteaArchiveUrl(config, url) {
1435
+ const giteaUrl = parseGiteaUrl(config, url);
1436
+ return `${giteaUrl.url}/api/v1/repos/${giteaUrl.owner}/${giteaUrl.name}/archive/${giteaUrl.ref}.tar.gz`;
1437
+ }
1438
+ function getGiteaLatestCommitUrl(config, url) {
1439
+ const giteaUrl = parseGiteaUrl(config, url);
1440
+ return `${giteaUrl.url}/api/v1/repos/${giteaUrl.owner}/${giteaUrl.name}/git/commits/${giteaUrl.ref}`;
1447
1441
  }
1448
1442
  function getGiteaRequestOptions(config) {
1449
1443
  const headers = {};
@@ -1462,6 +1456,23 @@ function getGiteaRequestOptions(config) {
1462
1456
  headers
1463
1457
  };
1464
1458
  }
1459
+ function parseGiteaUrl(config, url) {
1460
+ var _a;
1461
+ const baseUrl = (_a = config.baseUrl) != null ? _a : `https://${config.host}`;
1462
+ try {
1463
+ const [_blank, owner, name, _src, _branch, ref, ...path] = url.replace(baseUrl, "").split("/");
1464
+ const pathWithoutSlash = path.join("/").replace(/^\//, "");
1465
+ return {
1466
+ url: baseUrl,
1467
+ owner,
1468
+ name,
1469
+ ref,
1470
+ path: pathWithoutSlash
1471
+ };
1472
+ } catch (e) {
1473
+ throw new Error(`Incorrect URL: ${url}, ${e}`);
1474
+ }
1475
+ }
1465
1476
 
1466
1477
  var __defProp$6 = Object.defineProperty;
1467
1478
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -2261,11 +2272,15 @@ exports.getGitHubRequestOptions = getGitHubRequestOptions;
2261
2272
  exports.getGitLabFileFetchUrl = getGitLabFileFetchUrl;
2262
2273
  exports.getGitLabIntegrationRelativePath = getGitLabIntegrationRelativePath;
2263
2274
  exports.getGitLabRequestOptions = getGitLabRequestOptions;
2275
+ exports.getGiteaArchiveUrl = getGiteaArchiveUrl;
2276
+ exports.getGiteaEditContentsUrl = getGiteaEditContentsUrl;
2264
2277
  exports.getGiteaFileContentsUrl = getGiteaFileContentsUrl;
2278
+ exports.getGiteaLatestCommitUrl = getGiteaLatestCommitUrl;
2265
2279
  exports.getGiteaRequestOptions = getGiteaRequestOptions;
2266
2280
  exports.getGithubFileFetchUrl = getGithubFileFetchUrl;
2267
2281
  exports.parseGerritGitilesUrl = parseGerritGitilesUrl;
2268
2282
  exports.parseGerritJsonResponse = parseGerritJsonResponse;
2283
+ exports.parseGiteaUrl = parseGiteaUrl;
2269
2284
  exports.readAwsS3IntegrationConfig = readAwsS3IntegrationConfig;
2270
2285
  exports.readAwsS3IntegrationConfigs = readAwsS3IntegrationConfigs;
2271
2286
  exports.readAzureIntegrationConfig = readAzureIntegrationConfig;