import { CLOSEBOT_AGENCY_SCHEMA } from "@automate.ax/integration-contracts/closebot" import { defineAction } from "../../../automation/actions" import { CLOSEBOT_ACCOUNT, getCloseBotApi } from "./lib" /** Retrieves the agency available to the connected CloseBot API key. */ export const getCloseBotAgency = defineAction("Get CloseBot agency") .describe("Retrieves the agency available to the connected API key.") .account(CLOSEBOT_ACCOUNT) .output(CLOSEBOT_AGENCY_SCHEMA) .retry({ replaySafety: "safe" }) .handler(async ({ account }) => getCloseBotApi(account.secret).request("agency/current", { responseSchema: CLOSEBOT_AGENCY_SCHEMA, }), )