• Used to define a Connector Action.

    Type Parameters

    Returns (<Name, InputParamsSchema>(definition) => ActionDefinition<Name, InputParamsSchema, CredentialType>)

      • <Name, InputParamsSchema>(definition): ActionDefinition<Name, InputParamsSchema, CredentialType>
      • Type Parameters

        • Name extends string

        • InputParamsSchema extends TObject<TProperties>

        Parameters

        Returns ActionDefinition<Name, InputParamsSchema, CredentialType>

    Example

    import { defineAction } from "@rollout/framework";
    import { MyAppCredential } from "./auth";

    const inputParamsSchema: z.object({
    name: z.string()
    });

    export const action = defineAction<MyAppCredential>()({
    name: "My Action",
    inputParamsSchema,
    async execute({ credential, resolvedInputParams }) {
    // Execute the action here.
    // Return the output.
    return {};
    }
    });