import { typescriptFileProvider } from '@baseplate-dev/core-generators';
import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, pothosImportsProvider, prismaImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
import { createGeneratorTask, createProviderType } from '@baseplate-dev/sync';
import { AUTH0_AUTH0_MODULE_PATHS } from './template-paths.js';
import { AUTH0_AUTH0_MODULE_TEMPLATES } from './typed-templates.js';
const auth0Auth0ModuleRenderers = createProviderType('auth0-auth0-module-renderers');
const auth0Auth0ModuleRenderersTask = createGeneratorTask({
    dependencies: {
        authContextImports: authContextImportsProvider,
        authRolesImports: authRolesImportsProvider,
        configServiceImports: configServiceImportsProvider,
        paths: AUTH0_AUTH0_MODULE_PATHS.provider,
        pothosImports: pothosImportsProvider,
        prismaImports: prismaImportsProvider,
        typescriptFile: typescriptFileProvider,
        userSessionTypesImports: userSessionTypesImportsProvider,
    },
    exports: { auth0Auth0ModuleRenderers: auth0Auth0ModuleRenderers.export() },
    run({ authContextImports, authRolesImports, configServiceImports, paths, pothosImports, prismaImports, typescriptFile, userSessionTypesImports, }) {
        return {
            providers: {
                auth0Auth0ModuleRenderers: {
                    management: {
                        render: (options) => typescriptFile.renderTemplateFile({
                            template: AUTH0_AUTH0_MODULE_TEMPLATES.management,
                            destination: paths.management,
                            importMapProviders: {
                                configServiceImports,
                            },
                            ...options,
                        }),
                    },
                    userSessionQueries: {
                        render: (options) => typescriptFile.renderTemplateFile({
                            template: AUTH0_AUTH0_MODULE_TEMPLATES.userSessionQueries,
                            destination: paths.userSessionQueries,
                            importMapProviders: {
                                pothosImports,
                                prismaImports,
                            },
                            ...options,
                        }),
                    },
                    userSessionService: {
                        render: (options) => typescriptFile.renderTemplateFile({
                            template: AUTH0_AUTH0_MODULE_TEMPLATES.userSessionService,
                            destination: paths.userSessionService,
                            importMapProviders: {
                                authContextImports,
                                authRolesImports,
                                userSessionTypesImports,
                            },
                            ...options,
                        }),
                    },
                },
            },
        };
    },
});
export const AUTH0_AUTH0_MODULE_RENDERERS = {
    provider: auth0Auth0ModuleRenderers,
    task: auth0Auth0ModuleRenderersTask,
};
//# sourceMappingURL=template-renderers.js.map