/* oxlint-disable typescript/no-unsafe-type-assertion -- Hand-authored manifest aliases index the matching named action exports. */ import { HIGH_LEVEL_OPERATION_DEFINITIONS } from "@automate.ax/integration-contracts/highlevel" import * as actions from "./actions" import * as triggers from "./triggers" import { defineAccount } from "../../automation/integrations" /** Declares a named HighLevel sub-account binding for an automation. */ export const highLevelAccount = defineAccount("highlevel") /** Public HighLevel aliases indexed from the frozen operation manifest. */ type HighLevelActionAliases = { [TDefinition in (typeof HIGH_LEVEL_OPERATION_DEFINITIONS)[number] as TDefinition["alias"]]: (typeof actions)[TDefinition["exportName"]] } /** Named action object merged with HighLevel's trigger aliases. */ const highLevelActions = Object.fromEntries( HIGH_LEVEL_OPERATION_DEFINITIONS.map(({ alias, exportName }) => [ alias, actions[exportName], ]), ) as HighLevelActionAliases /** HighLevel CRM actions and signed webhook triggers. */ export const highlevel = { ...highLevelActions, onAppointmentCreated: triggers.onHighLevelAppointmentCreated, onAppointmentDeleted: triggers.onHighLevelAppointmentDeleted, onAppointmentUpdated: triggers.onHighLevelAppointmentUpdated, onCampaignStatusUpdated: triggers.onHighLevelCampaignStatusUpdated, onContactCreated: triggers.onHighLevelContactCreated, onContactDeleted: triggers.onHighLevelContactDeleted, onContactDndUpdated: triggers.onHighLevelContactDndUpdated, onContactTagsUpdated: triggers.onHighLevelContactTagsUpdated, onContactUpdated: triggers.onHighLevelContactUpdated, onConversationUnreadUpdated: triggers.onHighLevelConversationUnreadUpdated, onConversationUpdated: triggers.onHighLevelConversationUpdated, onEvent: triggers.onHighLevelEvent, onLocationUpdated: triggers.onHighLevelLocationUpdated, onMessageReceived: triggers.onHighLevelMessageReceived, onMessageSent: triggers.onHighLevelMessageSent, onNoteCreated: triggers.onHighLevelNoteCreated, onNoteDeleted: triggers.onHighLevelNoteDeleted, onNoteUpdated: triggers.onHighLevelNoteUpdated, onOpportunityAssigneeUpdated: triggers.onHighLevelOpportunityAssigneeUpdated, onOpportunityCreated: triggers.onHighLevelOpportunityCreated, onOpportunityDeleted: triggers.onHighLevelOpportunityDeleted, onOpportunityStageUpdated: triggers.onHighLevelOpportunityStageUpdated, onOpportunityStatusUpdated: triggers.onHighLevelOpportunityStatusUpdated, onOpportunityUpdated: triggers.onHighLevelOpportunityUpdated, onOpportunityValueUpdated: triggers.onHighLevelOpportunityValueUpdated, onTaskCompleted: triggers.onHighLevelTaskCompleted, onTaskCreated: triggers.onHighLevelTaskCreated, onTaskDeleted: triggers.onHighLevelTaskDeleted, onUserCreated: triggers.onHighLevelUserCreated, onUserDeleted: triggers.onHighLevelUserDeleted, onUserUpdated: triggers.onHighLevelUserUpdated, } export * from "./actions" export * from "./triggers" export * from "@automate.ax/integration-contracts/highlevel"