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

//#region src/routes/bitbucket.routes.ts
const bitbucketRoute = "/api/bitbucket";
const baseURL = () => `${process.env.BACKEND_URL}${bitbucketRoute}`;
const getBitbucketRoutes = () => ({
	getAuthUrl: {
		urlModel: "/auth-url",
		url: `${baseURL()}/auth-url`,
		method: "GET"
	},
	authCallback: {
		urlModel: "/auth",
		url: `${baseURL()}/auth`,
		method: "POST"
	},
	listRepos: {
		urlModel: "/repos",
		url: `${baseURL()}/repos`,
		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 bitbucketRouter = async (fastify) => {
	fastify.get(getBitbucketRoutes().getAuthUrl.urlModel, getAuthUrl);
	fastify.post(getBitbucketRoutes().authCallback.urlModel, authCallback);
	fastify.get(getBitbucketRoutes().listRepos.urlModel, listRepos);
	fastify.post(getBitbucketRoutes().checkConfig.urlModel, checkConfig);
	fastify.post(getBitbucketRoutes().getConfigFile.urlModel, getConfigFile);
};

//#endregion
export { bitbucketRoute, bitbucketRouter, getBitbucketRoutes };
//# sourceMappingURL=bitbucket.routes.mjs.map