import { authCallback, checkConfig, getAuthUrl, getConfigFile, listProjects } from "../controllers/gitlab.controller.mjs";

//#region src/routes/gitlab.routes.ts
const gitlabRoute = "/api/gitlab";
const baseURL = () => `${process.env.BACKEND_URL}${gitlabRoute}`;
const getGitlabRoutes = () => ({
	getAuthUrl: {
		urlModel: "/auth-url",
		url: `${baseURL()}/auth-url`,
		method: "GET"
	},
	authCallback: {
		urlModel: "/auth",
		url: `${baseURL()}/auth`,
		method: "POST"
	},
	listProjects: {
		urlModel: "/projects",
		url: `${baseURL()}/projects`,
		method: "GET"
	},
	checkConfig: {
		urlModel: "/check-config",
		url: `${baseURL()}/check-config`,
		method: "POST"
	},
	getConfigFile: {
		urlModel: "/get-config-file",
		url: `${baseURL()}/get-config-file`,
		method: "POST"
	}
});
const gitlabRouter = async (fastify) => {
	fastify.get(getGitlabRoutes().getAuthUrl.urlModel, getAuthUrl);
	fastify.post(getGitlabRoutes().authCallback.urlModel, authCallback);
	fastify.get(getGitlabRoutes().listProjects.urlModel, listProjects);
	fastify.post(getGitlabRoutes().checkConfig.urlModel, checkConfig);
	fastify.post(getGitlabRoutes().getConfigFile.urlModel, getConfigFile);
};

//#endregion
export { getGitlabRoutes, gitlabRoute, gitlabRouter };
//# sourceMappingURL=gitlab.routes.mjs.map