import { authConfigSpec, createPlatformPluginExport, pluginConfigSpec, PluginUtils, } from '@baseplate-dev/project-builder-lib';
import { createAuthPluginDefinitionSchema } from './schema/plugin-definition.js';
export default createPlatformPluginExport({
    dependencies: {
        config: pluginConfigSpec,
    },
    exports: {
        authConfig: authConfigSpec,
    },
    initialize: ({ config }, { pluginKey }) => {
        config.registerSchemaCreator(pluginKey, createAuthPluginDefinitionSchema);
        return {
            authConfig: {
                getAuthRoles: (definition) => {
                    const pluginConfig = PluginUtils.configByKeyOrThrow(definition, pluginKey);
                    return pluginConfig.roles;
                },
            },
        };
    },
});
//# sourceMappingURL=common.js.map