@backstage/plugin-catalog-backend 1.1.2-next.0 → 1.1.2

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,53 @@
1
1
  # @backstage/plugin-catalog-backend
2
2
 
3
+ ## 1.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 16a40ac4c0: Fix wrong return type of the `isGroupEntity` function.
8
+ - 55e09b29dd: Fixing broken types for `knex` when checking returned rows
9
+ - 1ccbe081cc: Minor internal tweak to support TypeScript 4.6
10
+ - cfc0f19699: Updated dependency `fs-extra` to `10.1.0`.
11
+ - 2909746147: Updated parseEntityTransformParams to handle keys with '.' in them. This will allow for querying of entities based off annotations such as 'backstage.io/orgin-location' or other entity field keys that have '.' in them.
12
+ - 8cc75993a6: Fixed issue in `PermissionEvaluator` instance check that would cause unexpected "invalid union" errors.
13
+ - Updated dependencies
14
+ - @backstage/backend-common@0.13.3
15
+ - @backstage/integration@1.2.0
16
+ - @backstage/plugin-scaffolder-common@1.1.0
17
+ - @backstage/config@1.0.1
18
+ - @backstage/plugin-search-common@0.3.4
19
+ - @backstage/catalog-client@1.0.2
20
+ - @backstage/catalog-model@1.0.2
21
+ - @backstage/plugin-catalog-common@1.0.2
22
+ - @backstage/plugin-permission-common@0.6.1
23
+ - @backstage/plugin-permission-node@0.6.1
24
+
25
+ ## 1.1.2-next.2
26
+
27
+ ### Patch Changes
28
+
29
+ - 16a40ac4c0: Fix wrong return type of the `isGroupEntity` function.
30
+ - 2909746147: Updated parseEntityTransformParams to handle keys with '.' in them. This will allow for querying of entities based off annotations such as 'backstage.io/orgin-location' or other entity field keys that have '.' in them.
31
+ - Updated dependencies
32
+ - @backstage/backend-common@0.13.3-next.2
33
+ - @backstage/plugin-scaffolder-common@1.1.0-next.0
34
+ - @backstage/config@1.0.1-next.0
35
+ - @backstage/plugin-search-common@0.3.4-next.0
36
+ - @backstage/catalog-model@1.0.2-next.0
37
+ - @backstage/integration@1.2.0-next.1
38
+ - @backstage/plugin-permission-common@0.6.1-next.0
39
+ - @backstage/plugin-permission-node@0.6.1-next.1
40
+ - @backstage/catalog-client@1.0.2-next.0
41
+ - @backstage/plugin-catalog-common@1.0.2-next.0
42
+
43
+ ## 1.1.2-next.1
44
+
45
+ ### Patch Changes
46
+
47
+ - 1ccbe081cc: Minor internal tweak to support TypeScript 4.6
48
+ - Updated dependencies
49
+ - @backstage/backend-common@0.13.3-next.1
50
+
3
51
  ## 1.1.2-next.0
4
52
 
5
53
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend",
3
- "version": "1.1.2-next.0",
3
+ "version": "1.1.2",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
package/dist/index.cjs.js CHANGED
@@ -2079,11 +2079,11 @@ class DefaultEntitiesCatalog {
2079
2079
  }
2080
2080
  async entities(request) {
2081
2081
  const db = this.database;
2082
- let entitiesQuery = db("final_entities");
2082
+ let entitiesQuery = db("final_entities").select("final_entities.*");
2083
2083
  if (request == null ? void 0 : request.filter) {
2084
2084
  entitiesQuery = parseFilter(request.filter, entitiesQuery, db);
2085
2085
  }
2086
- entitiesQuery = entitiesQuery.select("final_entities.*").whereNotNull("final_entities.final_entity").orderBy("entity_id", "asc");
2086
+ entitiesQuery = entitiesQuery.whereNotNull("final_entities.final_entity").orderBy("entity_id", "asc");
2087
2087
  const { limit, offset } = parsePagination(request == null ? void 0 : request.pagination);
2088
2088
  if (limit !== void 0) {
2089
2089
  entitiesQuery = entitiesQuery.limit(limit + 1);
@@ -2815,6 +2815,17 @@ function parseEntityPaginationParams(params) {
2815
2815
  };
2816
2816
  }
2817
2817
 
2818
+ function getPathArrayAndValue(input, field) {
2819
+ return field.split(".").reduce(([pathArray, inputSubset], pathPart, index, fieldParts) => {
2820
+ if (lodash__default["default"].hasIn(inputSubset, pathPart)) {
2821
+ return [pathArray.concat(pathPart), inputSubset[pathPart]];
2822
+ } else if (fieldParts[index + 1] !== void 0) {
2823
+ fieldParts[index + 1] = `${pathPart}.${fieldParts[index + 1]}`;
2824
+ return [pathArray, inputSubset];
2825
+ }
2826
+ return [pathArray, void 0];
2827
+ }, [[], input]);
2828
+ }
2818
2829
  function parseEntityTransformParams(params) {
2819
2830
  const fieldsStrings = parseStringsParam(params.fields, "fields");
2820
2831
  if (!fieldsStrings) {
@@ -2830,9 +2841,9 @@ function parseEntityTransformParams(params) {
2830
2841
  return (input) => {
2831
2842
  const output = {};
2832
2843
  for (const field of fields) {
2833
- const value = lodash__default["default"].get(input, field);
2844
+ const [pathArray, value] = getPathArrayAndValue(input, field);
2834
2845
  if (value !== void 0) {
2835
- lodash__default["default"].set(output, field, value);
2846
+ lodash__default["default"].set(output, pathArray, value);
2836
2847
  }
2837
2848
  }
2838
2849
  return output;