// Generated by notion tool-core codegen-script-types --connections. Do not edit. import type { ConnectionActionInvoker } from "./connection-actions.js" import type { WorkflowConnection, CalendarConnectionOptions, } from "./connections.js" import { CalendarConnectionClient } from "./calendar.generated.js" import { MailConnectionClient } from "./mail.generated.js" import { SlackConnectionClient } from "./slack.generated.js" import { GoogleDriveOauthConnectionClient } from "./googleDriveOauth.generated.js" import { DiscordConnectionClient } from "./discord.generated.js" import { CursorConnectionClient } from "./cursor.generated.js" import { BoxConnectionClient } from "./box.generated.js" import { ConfluenceConnectionClient } from "./confluence.generated.js" import { GoogleDriveConnectionClient } from "./googleDrive.generated.js" import { SalesforceConnectionClient } from "./salesforce.generated.js" export const connections = { calendar, mail, slack, googleDriveOauth, discord, cursor, box, confluence, googleDrive, salesforce, } export type ConnectionClients = { calendar: CalendarConnectionClient mail: MailConnectionClient slack: SlackConnectionClient googleDriveOauth: GoogleDriveOauthConnectionClient discord: DiscordConnectionClient cursor: CursorConnectionClient box: BoxConnectionClient confluence: ConfluenceConnectionClient googleDrive: GoogleDriveConnectionClient salesforce: SalesforceConnectionClient } export function createConnectionClient( provider: string, invoker: ConnectionActionInvoker, ): ConnectionClients[keyof ConnectionClients] { switch (provider) { case "calendar": return new CalendarConnectionClient(invoker) case "mail": return new MailConnectionClient(invoker) case "slack": return new SlackConnectionClient(invoker) case "googleDriveOauth": return new GoogleDriveOauthConnectionClient(invoker) case "discord": return new DiscordConnectionClient(invoker) case "cursor": return new CursorConnectionClient(invoker) case "box": return new BoxConnectionClient(invoker) case "confluence": return new ConfluenceConnectionClient(invoker) case "googleDrive": return new GoogleDriveConnectionClient(invoker) case "salesforce": return new SalesforceConnectionClient(invoker) default: throw new Error("Unsupported connection provider: " + provider) } } function calendar( options: TOptions & Record, never>, ): Omit, "calendar"> & { calendar: TOptions } { return { type: "calendar", calendar: structuredClone(options) } } function mail(): WorkflowConnection<"mail"> { return { type: "mail" } } function slack(): WorkflowConnection<"slack"> { return { type: "slack" } } function googleDriveOauth(): WorkflowConnection<"googleDriveOauth"> { return { type: "googleDriveOauth" } } function discord(): WorkflowConnection<"discord"> { return { type: "discord" } } function cursor(): WorkflowConnection<"cursor"> { return { type: "cursor" } } function box(): WorkflowConnection<"box"> { return { type: "box" } } function confluence(): WorkflowConnection<"confluence"> { return { type: "confluence" } } function googleDrive(): WorkflowConnection<"googleDrive"> { return { type: "googleDrive" } } function salesforce(): WorkflowConnection<"salesforce"> { return { type: "salesforce" } }