import { definePlugin, createPluginMethod } from "../../../utils/plugin-utils";
import { GetTriggerInputFieldsSchemaSchema } from "./schemas";
import { appKeyResolver, actionKeyResolver, connectionIdResolver, inputsAllOptionalResolver, } from "../../../resolvers";
import { triggersDefaults } from "../shared";
export const getTriggerInputFieldsSchemaPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
    ...triggersDefaults,
    name: "getTriggerInputFieldsSchema",
    type: "function",
    inputSchema: GetTriggerInputFieldsSchemaSchema,
    resolvers: {
        app: appKeyResolver,
        action: actionKeyResolver,
        connection: connectionIdResolver,
        inputs: inputsAllOptionalResolver,
        actionType: { type: "constant", value: "read" },
    },
    handler: async ({ sdk, options }) => {
        return sdk.getActionInputFieldsSchema({
            ...options,
            actionType: "read",
        });
    },
}));
