@backstage/plugin-catalog-backend 1.2.0-next.2 → 1.2.1-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,64 @@
1
1
  # @backstage/plugin-catalog-backend
2
2
 
3
+ ## 1.2.1-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f1dcc6f3c6: Use entity type predicates from catalog-model
8
+ - Updated dependencies
9
+ - @backstage/catalog-model@1.1.0-next.1
10
+ - @backstage/backend-common@0.14.1-next.1
11
+ - @backstage/errors@1.1.0-next.0
12
+ - @backstage/catalog-client@1.0.4-next.1
13
+ - @backstage/integration@1.2.2-next.1
14
+ - @backstage/plugin-catalog-common@1.0.4-next.0
15
+ - @backstage/plugin-permission-common@0.6.3-next.0
16
+ - @backstage/plugin-permission-node@0.6.3-next.1
17
+ - @backstage/plugin-search-common@0.3.6-next.0
18
+
19
+ ## 1.2.1-next.0
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+ - @backstage/backend-common@0.14.1-next.0
25
+ - @backstage/catalog-model@1.1.0-next.0
26
+ - @backstage/integration@1.2.2-next.0
27
+ - @backstage/plugin-permission-node@0.6.3-next.0
28
+ - @backstage/catalog-client@1.0.4-next.0
29
+ - @backstage/plugin-scaffolder-common@1.1.2-next.0
30
+
31
+ ## 1.2.0
32
+
33
+ ### Minor Changes
34
+
35
+ - b594679ae3: Allow array as non-spread arguments at the `CatalogBuilder`.
36
+
37
+ ```typescript
38
+ builder.addEntityProvider(...getArrayOfProviders());
39
+ ```
40
+
41
+ can be simplified to
42
+
43
+ ```typescript
44
+ builder.addEntityProvider(getArrayOfProviders());
45
+ ```
46
+
47
+ ### Patch Changes
48
+
49
+ - 8838b13038: Disallow anything but `'url'` locations from being registered via the location service.
50
+ - 8f7b1835df: Updated dependency `msw` to `^0.41.0`.
51
+ - Updated dependencies
52
+ - @backstage/plugin-search-common@0.3.5
53
+ - @backstage/plugin-permission-node@0.6.2
54
+ - @backstage/plugin-catalog-common@1.0.3
55
+ - @backstage/backend-common@0.14.0
56
+ - @backstage/integration@1.2.1
57
+ - @backstage/catalog-client@1.0.3
58
+ - @backstage/plugin-permission-common@0.6.2
59
+ - @backstage/catalog-model@1.0.3
60
+ - @backstage/plugin-scaffolder-common@1.1.1
61
+
3
62
  ## 1.2.0-next.2
4
63
 
5
64
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend",
3
- "version": "1.2.0-next.2",
3
+ "version": "1.2.1-next.1",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -555,7 +555,6 @@ export declare class DefaultCatalogCollator {
555
555
  catalogClient?: CatalogApi;
556
556
  });
557
557
  protected applyArgsToFormat(format: string, args: Record<string, string>): string;
558
- private isUserEntity;
559
558
  private getDocumentText;
560
559
  execute(): Promise<CatalogEntityDocument[]>;
561
560
  }
@@ -489,7 +489,6 @@ export declare class DefaultCatalogCollator {
489
489
  catalogClient?: CatalogApi;
490
490
  });
491
491
  protected applyArgsToFormat(format: string, args: Record<string, string>): string;
492
- private isUserEntity;
493
492
  private getDocumentText;
494
493
  execute(): Promise<CatalogEntityDocument[]>;
495
494
  }
package/dist/index.cjs.js CHANGED
@@ -781,17 +781,11 @@ function createRandomProcessingInterval(options) {
781
781
  };
782
782
  }
783
783
 
784
- function isUserEntity(entity) {
785
- return entity.kind.toLocaleUpperCase("en-US") === "USER";
786
- }
787
- function isGroupEntity(entity) {
788
- return entity.kind.toLocaleUpperCase("en-US") === "GROUP";
789
- }
790
784
  function getDocumentText(entity) {
791
785
  var _a, _b;
792
786
  const documentTexts = [];
793
787
  documentTexts.push(entity.metadata.description || "");
794
- if (isUserEntity(entity) || isGroupEntity(entity)) {
788
+ if (catalogModel.isUserEntity(entity) || catalogModel.isGroupEntity(entity)) {
795
789
  if ((_b = (_a = entity.spec) == null ? void 0 : _a.profile) == null ? void 0 : _b.displayName) {
796
790
  documentTexts.push(entity.spec.profile.displayName);
797
791
  }
@@ -890,13 +884,10 @@ class DefaultCatalogCollator {
890
884
  }
891
885
  return formatted.toLowerCase();
892
886
  }
893
- isUserEntity(entity) {
894
- return entity.kind.toLocaleUpperCase("en-US") === "USER";
895
- }
896
887
  getDocumentText(entity) {
897
888
  var _a, _b, _c, _d, _e, _f;
898
889
  let documentText = entity.metadata.description || "";
899
- if (this.isUserEntity(entity)) {
890
+ if (catalogModel.isUserEntity(entity)) {
900
891
  if (((_b = (_a = entity.spec) == null ? void 0 : _a.profile) == null ? void 0 : _b.displayName) && documentText) {
901
892
  const displayName = (_d = (_c = entity.spec) == null ? void 0 : _c.profile) == null ? void 0 : _d.displayName;
902
893
  documentText = displayName.concat(" : ", documentText);
@@ -1926,6 +1917,9 @@ class DefaultLocationService {
1926
1917
  this.orchestrator = orchestrator;
1927
1918
  }
1928
1919
  async createLocation(input, dryRun) {
1920
+ if (input.type !== "url") {
1921
+ throw new errors.InputError(`Registered locations must be of type 'url'`);
1922
+ }
1929
1923
  if (dryRun) {
1930
1924
  return this.dryRunCreateLocation(input);
1931
1925
  }