Merge pull request #9480 from backstage/jhaals/catalog-model-deprecations

catalog-model: deprecate unused exports
This commit is contained in:
Fredrik Adelöw
2022-02-11 18:18:48 +01:00
committed by GitHub
4 changed files with 15 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-model': patch
---
Deprecates the following exports which all have very limited and internal use. `ENTITY_META_GENERATED_FIELDS`, `entityHasChanges`, `generateEntityEtag`, `generateEntityUid`, `generateUpdatedEntity`, `ENTITY_META_GENERATED_FIELDS`.
+5 -5
View File
@@ -120,7 +120,7 @@ export type Entity = {
// @public
export const ENTITY_DEFAULT_NAMESPACE = 'default';
// @public
// @public @deprecated
export const ENTITY_META_GENERATED_FIELDS: readonly [
'uid',
'etag',
@@ -142,7 +142,7 @@ export function entityEnvelopeSchemaValidator<
T extends EntityEnvelope = EntityEnvelope,
>(schema?: unknown): (data: unknown) => T;
// @public
// @public @deprecated
export function entityHasChanges(previous: Entity, next: Entity): boolean;
// @public
@@ -246,13 +246,13 @@ export class FieldFormatEntityPolicy implements EntityPolicy {
enforce(entity: Entity): Promise<Entity>;
}
// @public
// @public @deprecated
export function generateEntityEtag(): string;
// @public
// @public @deprecated
export function generateEntityUid(): string;
// @public
// @public @deprecated
export function generateUpdatedEntity(previous: Entity, next: Entity): Entity;
// @public
@@ -25,6 +25,7 @@ export const ENTITY_DEFAULT_NAMESPACE = 'default';
* The keys of EntityMeta that are auto-generated.
*
* @public
* @deprecated will be removed in a future release.
*/
export const ENTITY_META_GENERATED_FIELDS = [
'uid',
@@ -23,6 +23,7 @@ import { Entity, AlphaEntity } from './Entity';
*
* @public
* @returns A string with enough randomness to uniquely identify an entity
* @deprecated use `uuidv4()` instead.
*/
export function generateEntityUid(): string {
return uuidv4();
@@ -34,6 +35,7 @@ export function generateEntityUid(): string {
* @public
* @returns A string with enough randomness to uniquely identify an entity
* revision
* @deprecated will be removed in a future release.
*/
export function generateEntityEtag(): string {
return Buffer.from(uuidv4(), 'utf8').toString('base64').replace(/[^\w]/g, '');
@@ -55,6 +57,7 @@ export function generateEntityEtag(): string {
* @public
* @param previous - The old state of the entity
* @param next - The new state of the entity
* @deprecated will be removed in a future release.
*/
export function entityHasChanges(previous: Entity, next: Entity): boolean {
const e1 = lodash.cloneDeep(previous);
@@ -109,6 +112,7 @@ export function entityHasChanges(previous: Entity, next: Entity): boolean {
* @param previous - The old state of the entity
* @param next - The new state of the entity
* @returns An entity with the merged state of both
* @deprecated will be removed in a future release.
*/
export function generateUpdatedEntity(previous: Entity, next: Entity): Entity {
const { uid, etag, generation } = previous.metadata;