import { checkCMSAuth } from "./utils/checkAccess.mjs";
import { getIntlayerAPIProxy } from "@intlayer/api";
import { getAppLogger, getConfiguration } from "@intlayer/config";

//#region src/pushConfig.ts
const pushConfig = async (options) => {
	const config = getConfiguration(options?.configOptions);
	const appLogger = getAppLogger(config, { config: { prefix: "" } });
	if (!await checkCMSAuth(config)) return;
	const getDictionariesKeysResult = await getIntlayerAPIProxy(void 0, config).project.pushProjectConfiguration(config);
	if (!getDictionariesKeysResult.data) throw new Error("Error pushing project configuration");
	appLogger("Project configuration pushed successfully");
	appLogger(JSON.stringify(getDictionariesKeysResult.data, null, 2));
};

//#endregion
export { pushConfig };
//# sourceMappingURL=pushConfig.mjs.map