import { importShared } from './__federation_fn_import-C_QCk5FX.js';
import { c as createAuth0PluginDefinitionSchema, A as AUTH0_MODELS } from './plugin-definition-rpMj4pr8.js';

const AUTH0_PLUGIN_CONFIG_MIGRATIONS = [
  {
    name: "move-models",
    version: 1,
    migrate: (config) => {
      const typedConfig = config;
      return {
        updatedConfig: {
          ...typedConfig,
          userAccountModelRef: void 0,
          modelRefs: {
            user: typedConfig.userAccountModelRef
          }
        }
      };
    }
  }
];

const {authModelConfigSpec,createPlatformPluginExport,ModelUtils,pluginConfigSpec} = await importShared('@baseplate-dev/project-builder-lib');
const common = createPlatformPluginExport({
  dependencies: {
    config: pluginConfigSpec
  },
  exports: {
    authModelConfig: authModelConfigSpec
  },
  initialize: ({ config }, { pluginKey }) => {
    config.registerSchemaCreator(pluginKey, createAuth0PluginDefinitionSchema);
    config.registerMigrations(pluginKey, AUTH0_PLUGIN_CONFIG_MIGRATIONS);
    return {
      authModelConfig: {
        getUserModel: (definition) => ModelUtils.byNameOrThrow(definition, AUTH0_MODELS.user)
      }
    };
  }
});

export { common as default };
//# sourceMappingURL=__federation_expose_auth0CoreCommon-Ga9LD3d6.js.map
