diff --git a/.changeset/plenty-kids-fetch.md b/.changeset/plenty-kids-fetch.md new file mode 100644 index 0000000000..6a31b4db20 --- /dev/null +++ b/.changeset/plenty-kids-fetch.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-client': patch +--- + +Renamed argument in `validateEntity` from `location` to `locationRef` diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index 0ad77ce39c..85fc389af7 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -68,7 +68,7 @@ export interface CatalogApi { ): Promise; validateEntity( entity: Entity, - location: string, + locationRef: string, options?: CatalogRequestOptions, ): Promise; } @@ -130,7 +130,7 @@ export class CatalogClient implements CatalogApi { ): Promise; validateEntity( entity: Entity, - location: string, + locationRef: string, options?: CatalogRequestOptions, ): Promise; } diff --git a/packages/catalog-client/src/CatalogClient.test.ts b/packages/catalog-client/src/CatalogClient.test.ts index 6c9c68efa2..5a344f49a3 100644 --- a/packages/catalog-client/src/CatalogClient.test.ts +++ b/packages/catalog-client/src/CatalogClient.test.ts @@ -322,7 +322,7 @@ describe('CatalogClient', () => { name: '', }, }, - 'http://example.com', + 'url:http://example.com', ), ).toMatchObject({ valid: false, @@ -350,7 +350,7 @@ describe('CatalogClient', () => { name: 'good', }, }, - 'http://example.com', + 'url:http://example.com', ), ).toMatchObject({ valid: true, @@ -373,7 +373,7 @@ describe('CatalogClient', () => { name: 'good', }, }, - 'http://example.com', + 'url:http://example.com', ), ).rejects.toThrow(/Request failed with 500 Error/); }); diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index f2b4186bfb..d67392d80d 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -359,7 +359,7 @@ export class CatalogClient implements CatalogApi { */ async validateEntity( entity: Entity, - location: string, + locationRef: string, options?: CatalogRequestOptions, ): Promise { const response = await this.fetchApi.fetch( @@ -370,7 +370,7 @@ export class CatalogClient implements CatalogApi { ...(options?.token && { Authorization: `Bearer ${options?.token}` }), }, method: 'POST', - body: JSON.stringify({ entity, location }), + body: JSON.stringify({ entity, location: locationRef }), }, ); diff --git a/packages/catalog-client/src/types/api.ts b/packages/catalog-client/src/types/api.ts index f483c3454c..d3d02022f3 100644 --- a/packages/catalog-client/src/types/api.ts +++ b/packages/catalog-client/src/types/api.ts @@ -405,11 +405,11 @@ export interface CatalogApi { * Validate entity and its location. * * @param entity - Entity to validate - * @param location - URL location of the entity + * @param locationRef - Location ref in format `url:http://example.com/file` */ validateEntity( entity: Entity, - location: string, + locationRef: string, options?: CatalogRequestOptions, ): Promise; }