'use strict';

var backendPluginApi = require('@backstage/backend-plugin-api');
var router = require('./router.cjs.js');
var GithubWorkflowsService = require('./services/GithubWorkflowsService.cjs.js');

const githubWorkflowBackendPlugin = backendPluginApi.createBackendPlugin({
  pluginId: "github-workflow-backend",
  register(env) {
    env.registerInit({
      deps: {
        httpAuth: backendPluginApi.coreServices.httpAuth,
        httpRouter: backendPluginApi.coreServices.httpRouter,
        config: backendPluginApi.coreServices.rootConfig,
        logger: backendPluginApi.coreServices.logger
      },
      async init({ httpAuth, httpRouter, config, logger }) {
        logger.info("Initializing GitHub Workflows backend plugin...");
        const githubWorkflowsService = new GithubWorkflowsService.GithubWorkflowsService(config, logger);
        logger.info("GitHub Workflows service created");
        const router$1 = await router.createRouter({
          httpAuth,
          githubWorkflowsService
        });
        logger.info("GitHub Workflows router created, registering routes...");
        httpRouter.use(router$1);
        logger.info("GitHub Workflows backend plugin initialized successfully");
      }
    });
  }
});

exports.githubWorkflowBackendPlugin = githubWorkflowBackendPlugin;
//# sourceMappingURL=plugin.cjs.js.map
