@backstage/plugin-catalog-backend 1.1.2-next.1 → 1.2.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,68 @@
1
1
  # @backstage/plugin-catalog-backend
2
2
 
3
+ ## 1.2.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b594679ae3: Allow array as non-spread arguments at the `CatalogBuilder`.
8
+
9
+ ```typescript
10
+ builder.addEntityProvider(...getArrayOfProviders());
11
+ ```
12
+
13
+ can be simplified to
14
+
15
+ ```typescript
16
+ builder.addEntityProvider(getArrayOfProviders());
17
+ ```
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+ - @backstage/backend-common@0.13.6-next.0
23
+ - @backstage/integration@1.2.1-next.0
24
+ - @backstage/plugin-permission-node@0.6.2-next.0
25
+
26
+ ## 1.1.2
27
+
28
+ ### Patch Changes
29
+
30
+ - 16a40ac4c0: Fix wrong return type of the `isGroupEntity` function.
31
+ - 55e09b29dd: Fixing broken types for `knex` when checking returned rows
32
+ - 1ccbe081cc: Minor internal tweak to support TypeScript 4.6
33
+ - cfc0f19699: Updated dependency `fs-extra` to `10.1.0`.
34
+ - 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.
35
+ - 8cc75993a6: Fixed issue in `PermissionEvaluator` instance check that would cause unexpected "invalid union" errors.
36
+ - Updated dependencies
37
+ - @backstage/backend-common@0.13.3
38
+ - @backstage/integration@1.2.0
39
+ - @backstage/plugin-scaffolder-common@1.1.0
40
+ - @backstage/config@1.0.1
41
+ - @backstage/plugin-search-common@0.3.4
42
+ - @backstage/catalog-client@1.0.2
43
+ - @backstage/catalog-model@1.0.2
44
+ - @backstage/plugin-catalog-common@1.0.2
45
+ - @backstage/plugin-permission-common@0.6.1
46
+ - @backstage/plugin-permission-node@0.6.1
47
+
48
+ ## 1.1.2-next.2
49
+
50
+ ### Patch Changes
51
+
52
+ - 16a40ac4c0: Fix wrong return type of the `isGroupEntity` function.
53
+ - 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.
54
+ - Updated dependencies
55
+ - @backstage/backend-common@0.13.3-next.2
56
+ - @backstage/plugin-scaffolder-common@1.1.0-next.0
57
+ - @backstage/config@1.0.1-next.0
58
+ - @backstage/plugin-search-common@0.3.4-next.0
59
+ - @backstage/catalog-model@1.0.2-next.0
60
+ - @backstage/integration@1.2.0-next.1
61
+ - @backstage/plugin-permission-common@0.6.1-next.0
62
+ - @backstage/plugin-permission-node@0.6.1-next.1
63
+ - @backstage/catalog-client@1.0.2-next.0
64
+ - @backstage/plugin-catalog-common@1.0.2-next.0
65
+
3
66
  ## 1.1.2-next.1
4
67
 
5
68
  ### Patch Changes
@@ -455,7 +518,7 @@
455
518
  - 022507c860: A `DefaultCatalogCollatorFactory`, which works with the new stream-based
456
519
  search indexing subsystem, is now available. The `DefaultCatalogCollator` will
457
520
  continue to be available for those unable to upgrade to the stream-based
458
- `@backstage/search-backend-node` (and related packages), however it is now
521
+ `@backstage/plugin-search-backend-node` (and related packages), however it is now
459
522
  marked as deprecated and will be removed in a future version.
460
523
 
461
524
  To upgrade this plugin and the search indexing subsystem in one go, check
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend",
3
- "version": "1.1.2-next.1",
3
+ "version": "1.2.0-next.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -170,7 +170,7 @@ export declare class CatalogBuilder {
170
170
  *
171
171
  * @param policies - One or more policies
172
172
  */
173
- addEntityPolicy(...policies: EntityPolicy[]): CatalogBuilder;
173
+ addEntityPolicy(...policies: Array<EntityPolicy | Array<EntityPolicy>>): CatalogBuilder;
174
174
  /**
175
175
  * Processing interval determines how often entities should be processed.
176
176
  * Seconds provided will be multiplied by 1.5
@@ -229,14 +229,14 @@ export declare class CatalogBuilder {
229
229
  *
230
230
  * @param providers - One or more entity providers
231
231
  */
232
- addEntityProvider(...providers: EntityProvider[]): CatalogBuilder;
232
+ addEntityProvider(...providers: Array<EntityProvider | Array<EntityProvider>>): CatalogBuilder;
233
233
  /**
234
234
  * Adds entity processors. These are responsible for reading, parsing, and
235
235
  * processing entities before they are persisted in the catalog.
236
236
  *
237
237
  * @param processors - One or more processors
238
238
  */
239
- addProcessor(...processors: CatalogProcessor[]): CatalogBuilder;
239
+ addProcessor(...processors: Array<CatalogProcessor | Array<CatalogProcessor>>): CatalogBuilder;
240
240
  /**
241
241
  * Sets what entity processors to use. These are responsible for reading,
242
242
  * parsing, and processing entities before they are persisted in the catalog.
@@ -274,7 +274,7 @@ export declare class CatalogBuilder {
274
274
  * @param permissionRules - Additional permission rules
275
275
  * @alpha
276
276
  */
277
- addPermissionRules(...permissionRules: CatalogPermissionRule[]): void;
277
+ addPermissionRules(...permissionRules: Array<CatalogPermissionRule | Array<CatalogPermissionRule>>): void;
278
278
  /**
279
279
  * Wires up and returns all of the component parts of the catalog
280
280
  */
@@ -531,7 +531,7 @@ export declare function createRandomProcessingInterval(options: {
531
531
 
532
532
  /**
533
533
  * @public
534
- * @deprecated Upgrade to a more recent `@backstage/search-backend-node` and
534
+ * @deprecated Upgrade to a more recent `@backstage/plugin-search-backend-node` and
535
535
  * use `DefaultCatalogCollatorFactory` instead.
536
536
  */
537
537
  export declare class DefaultCatalogCollator {
@@ -170,7 +170,7 @@ export declare class CatalogBuilder {
170
170
  *
171
171
  * @param policies - One or more policies
172
172
  */
173
- addEntityPolicy(...policies: EntityPolicy[]): CatalogBuilder;
173
+ addEntityPolicy(...policies: Array<EntityPolicy | Array<EntityPolicy>>): CatalogBuilder;
174
174
  /**
175
175
  * Processing interval determines how often entities should be processed.
176
176
  * Seconds provided will be multiplied by 1.5
@@ -229,14 +229,14 @@ export declare class CatalogBuilder {
229
229
  *
230
230
  * @param providers - One or more entity providers
231
231
  */
232
- addEntityProvider(...providers: EntityProvider[]): CatalogBuilder;
232
+ addEntityProvider(...providers: Array<EntityProvider | Array<EntityProvider>>): CatalogBuilder;
233
233
  /**
234
234
  * Adds entity processors. These are responsible for reading, parsing, and
235
235
  * processing entities before they are persisted in the catalog.
236
236
  *
237
237
  * @param processors - One or more processors
238
238
  */
239
- addProcessor(...processors: CatalogProcessor[]): CatalogBuilder;
239
+ addProcessor(...processors: Array<CatalogProcessor | Array<CatalogProcessor>>): CatalogBuilder;
240
240
  /**
241
241
  * Sets what entity processors to use. These are responsible for reading,
242
242
  * parsing, and processing entities before they are persisted in the catalog.
@@ -465,7 +465,7 @@ export declare function createRandomProcessingInterval(options: {
465
465
 
466
466
  /**
467
467
  * @public
468
- * @deprecated Upgrade to a more recent `@backstage/search-backend-node` and
468
+ * @deprecated Upgrade to a more recent `@backstage/plugin-search-backend-node` and
469
469
  * use `DefaultCatalogCollatorFactory` instead.
470
470
  */
471
471
  export declare class DefaultCatalogCollator {
package/dist/index.cjs.js CHANGED
@@ -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;
@@ -3386,7 +3397,7 @@ class CatalogBuilder {
3386
3397
  return new CatalogBuilder(env);
3387
3398
  }
3388
3399
  addEntityPolicy(...policies) {
3389
- this.entityPolicies.push(...policies);
3400
+ this.entityPolicies.push(...policies.flat());
3390
3401
  return this;
3391
3402
  }
3392
3403
  setProcessingIntervalSeconds(seconds) {
@@ -3418,11 +3429,11 @@ class CatalogBuilder {
3418
3429
  return this;
3419
3430
  }
3420
3431
  addEntityProvider(...providers) {
3421
- this.entityProviders.push(...providers);
3432
+ this.entityProviders.push(...providers.flat());
3422
3433
  return this;
3423
3434
  }
3424
3435
  addProcessor(...processors) {
3425
- this.processors.push(...processors);
3436
+ this.processors.push(...processors.flat());
3426
3437
  return this;
3427
3438
  }
3428
3439
  replaceProcessors(processors) {
@@ -3445,7 +3456,7 @@ class CatalogBuilder {
3445
3456
  return this;
3446
3457
  }
3447
3458
  addPermissionRules(...permissionRules) {
3448
- this.permissionRules.push(...permissionRules);
3459
+ this.permissionRules.push(...permissionRules.flat());
3449
3460
  }
3450
3461
  async build() {
3451
3462
  var _a, _b;