catalog-backend: removed RecursivePartial export

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-03-14 17:14:19 +01:00
parent 8ed8e26247
commit 74375be2c6
10 changed files with 32 additions and 31 deletions
+15
View File
@@ -0,0 +1,15 @@
---
'@backstage/plugin-catalog-backend': minor
---
**BREAKING**: Removed the export of the `RecursivePartial` utility type. If you relied on this type it can be redefined like this:
```ts
type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
? RecursivePartial<U>[]
: T[P] extends object
? RecursivePartial<T[P]>
: T[P];
};
```
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-ldap': patch
---
Updated to no longer rely on the `RecursivePartial` export from `@backstage/plugin-catalog-backend`.
@@ -18,8 +18,8 @@ import { Config } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { SearchOptions } from 'ldapjs';
import mergeWith from 'lodash/mergeWith';
import { RecursivePartial } from '@backstage/plugin-catalog-backend';
import { trimEnd } from 'lodash';
import { RecursivePartial } from './util';
/**
* The configuration parameters for a single LDAP provider.
@@ -17,7 +17,6 @@
import { GroupEntity, UserEntity } from '@backstage/catalog-model';
import { SearchEntry } from 'ldapjs';
import merge from 'lodash/merge';
import { RecursivePartial } from '@backstage/plugin-catalog-backend';
import { LdapClient } from './client';
import { GroupConfig, UserConfig } from './config';
import {
@@ -32,6 +31,7 @@ import {
readLdapUsers,
resolveRelations,
} from './read';
import { RecursivePartial } from './util';
import { ActiveDirectoryVendor, DefaultLdapVendor } from './vendors';
function user(data: RecursivePartial<UserEntity>): UserEntity {
@@ -53,3 +53,11 @@ export function mapStringAttr(
}
}
}
export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
? RecursivePartial<U>[]
: T[P] extends object
? RecursivePartial<T[P]>
: T[P];
};
-9
View File
@@ -762,15 +762,6 @@ export const processingResult: Readonly<{
readonly relation: (spec: EntityRelationSpec) => CatalogProcessorResult;
}>;
// @public
export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
? RecursivePartial<U>[]
: T[P] extends object
? RecursivePartial<T[P]>
: T[P];
};
// @public
export type RefreshOptions = {
entityRef: string;
-1
View File
@@ -25,7 +25,6 @@ export * from './catalog';
export * from './ingestion';
export * from './modules';
export * from './search';
export * from './util';
export * from './processing';
export * from './service';
export * from './permissions';
@@ -17,7 +17,7 @@
import { Entity } from '@backstage/catalog-model';
import { InputError } from '@backstage/errors';
import lodash from 'lodash';
import { RecursivePartial } from '../../util';
import { RecursivePartial } from '../../util/RecursivePartial';
import { parseStringsParam } from './common';
export function parseEntityTransformParams(
@@ -16,7 +16,7 @@
/**
* Makes all keys of an entire hierarchy optional.
* @public
* @ignore
*/
export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
-17
View File
@@ -1,17 +0,0 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './RecursivePartial';