diff --git a/.changeset/big-roses-stare.md b/.changeset/big-roses-stare.md new file mode 100644 index 0000000000..442e53522e --- /dev/null +++ b/.changeset/big-roses-stare.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-msgraph': patch +--- + +export the function to read ms graph provider config diff --git a/plugins/catalog-backend-module-msgraph/api-report.md b/plugins/catalog-backend-module-msgraph/api-report.md index 3e4d8d99bc..7f5c4b804c 100644 --- a/plugins/catalog-backend-module-msgraph/api-report.md +++ b/plugins/catalog-backend-module-msgraph/api-report.md @@ -261,6 +261,17 @@ export function readMicrosoftGraphOrg( groups: GroupEntity[]; }>; +// @public +export function readProviderConfig( + id: string, + config: Config, +): MicrosoftGraphProviderConfig; + +// @public +export function readProviderConfigs( + config: Config, +): MicrosoftGraphProviderConfig[]; + // @public export type UserTransformer = ( user: MicrosoftGraph.User, diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.ts index cf4ec646a2..1d9592e96f 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/config.ts @@ -226,6 +226,13 @@ export function readMicrosoftGraphConfig( return providers; } +/** + * Parses all configured providers. + * + * @param config - The root of the msgraph config hierarchy + * + * @public + */ export function readProviderConfigs( config: Config, ): MicrosoftGraphProviderConfig[] { @@ -248,6 +255,14 @@ export function readProviderConfigs( }); } +/** + * Parses a single configured provider by id. + * + * @param id - the id of the provider to parse + * @param config - The root of the msgraph config hierarchy + * + * @public + */ export function readProviderConfig( id: string, config: Config, diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/index.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/index.ts index 37dcffec22..4db3fb69c6 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/index.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/index.ts @@ -16,7 +16,11 @@ export { MicrosoftGraphClient } from './client'; export type { GroupMember, ODataQuery } from './client'; -export { readMicrosoftGraphConfig } from './config'; +export { + readMicrosoftGraphConfig, + readProviderConfigs, + readProviderConfig, +} from './config'; export type { MicrosoftGraphProviderConfig } from './config'; export { MICROSOFT_EMAIL_ANNOTATION,