diff --git a/.changeset/poor-cougars-remember.md b/.changeset/poor-cougars-remember.md new file mode 100644 index 0000000000..e667c8e69b --- /dev/null +++ b/.changeset/poor-cougars-remember.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-client': patch +--- + +Add the `presence` argument to the `CatalogApi` to be able to register optional locations. diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index 362b1e71da..c3d9749161 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -75,6 +75,7 @@ export class CatalogClient implements CatalogApi { type = 'url', target, dryRun, + presence, }: AddLocationRequest): Promise { const response = await fetch( `${await this.discoveryApi.getBaseUrl('catalog')}/locations${ @@ -85,7 +86,7 @@ export class CatalogClient implements CatalogApi { 'Content-Type': 'application/json', }, method: 'POST', - body: JSON.stringify({ type, target }), + body: JSON.stringify({ type, target, presence }), }, ); diff --git a/packages/catalog-client/src/types.ts b/packages/catalog-client/src/types.ts index e72317d444..52b001a2bc 100644 --- a/packages/catalog-client/src/types.ts +++ b/packages/catalog-client/src/types.ts @@ -40,6 +40,7 @@ export type AddLocationRequest = { type?: string; target: string; dryRun?: boolean; + presence?: 'optional' | 'required'; }; export type AddLocationResponse = {