@backstage/plugin-catalog-backend 1.5.0 → 1.5.1-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,26 @@
1
1
  # @backstage/plugin-catalog-backend
2
2
 
3
+ ## 1.5.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - a7607b5413: Replace usage of deprecataed `UrlReader.read` with `UrlReader.readUrl`.
8
+ - Updated dependencies
9
+ - @backstage/backend-common@0.16.0-next.0
10
+ - @backstage/integration@1.4.0-next.0
11
+ - @backstage/catalog-model@1.1.3-next.0
12
+ - @backstage/plugin-permission-common@0.7.1-next.0
13
+ - @backstage/types@1.0.1-next.0
14
+ - @backstage/backend-plugin-api@0.1.4-next.0
15
+ - @backstage/plugin-catalog-node@1.2.1-next.0
16
+ - @backstage/plugin-permission-node@0.7.1-next.0
17
+ - @backstage/catalog-client@1.1.2-next.0
18
+ - @backstage/config@1.0.4-next.0
19
+ - @backstage/errors@1.1.3-next.0
20
+ - @backstage/plugin-catalog-common@1.0.8-next.0
21
+ - @backstage/plugin-scaffolder-common@1.2.2-next.0
22
+ - @backstage/plugin-search-common@1.1.1-next.0
23
+
3
24
  ## 1.5.0
4
25
 
5
26
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend",
3
- "version": "1.5.0",
3
+ "version": "1.5.1-next.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
package/dist/index.cjs.js CHANGED
@@ -102,13 +102,9 @@ const scmCodeOwnersPaths = {
102
102
  async function readCodeOwners(reader, sourceUrl, codeownersPaths) {
103
103
  const readOwnerLocation = async (path) => {
104
104
  const url = `${sourceUrl}${path}`;
105
- if (reader.readUrl) {
106
- const data2 = await reader.readUrl(url);
107
- const buffer = await data2.buffer();
108
- return buffer.toString();
109
- }
110
- const data = await reader.read(url);
111
- return data.toString();
105
+ const data = await reader.readUrl(url);
106
+ const buffer = await data.buffer();
107
+ return buffer.toString();
112
108
  };
113
109
  const candidates = codeownersPaths.map(readOwnerLocation);
114
110
  return Promise.any(candidates).catch((aggregateError) => {
@@ -612,12 +608,9 @@ class PlaceholderProcessor {
612
608
  return [data, false];
613
609
  }
614
610
  const read = async (url) => {
615
- if (this.options.reader.readUrl) {
616
- const response = await this.options.reader.readUrl(url);
617
- const buffer = await response.buffer();
618
- return buffer;
619
- }
620
- return this.options.reader.read(url);
611
+ const response = await this.options.reader.readUrl(url);
612
+ const buffer = await response.buffer();
613
+ return buffer;
621
614
  };
622
615
  const resolveUrl = (url, base) => this.options.integrations.resolveUrl({
623
616
  url,
@@ -779,15 +772,11 @@ class UrlReaderProcessor {
779
772
  }));
780
773
  return { response: await Promise.all(output), etag: response.etag };
781
774
  }
782
- if (this.options.reader.readUrl) {
783
- const data2 = await this.options.reader.readUrl(location, { etag });
784
- return {
785
- response: [{ url: location, data: await data2.buffer() }],
786
- etag: data2.etag
787
- };
788
- }
789
- const data = await this.options.reader.read(location);
790
- return { response: [{ url: location, data }] };
775
+ const data = await this.options.reader.readUrl(location, { etag });
776
+ return {
777
+ response: [{ url: location, data: await data.buffer() }],
778
+ etag: data.etag
779
+ };
791
780
  }
792
781
  }
793
782