"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
const fields_1 = require("./fields");
const dynamic_fields_1 = require("./dynamic-fields");
const action = {
    title: 'Sync Audience',
    description: 'Sync users to a Sendgrid List',
    defaultSubscription: 'type = "identify" or type = "track"',
    fields: fields_1.fields,
    dynamicFields: {
        custom_text_fields: {
            __keys__: async (request, { payload }) => {
                return await (0, dynamic_fields_1.dynamicCustomFields)(request, payload, 'Text');
            }
        },
        custom_number_fields: {
            __keys__: async (request, { payload }) => {
                return await (0, dynamic_fields_1.dynamicCustomFields)(request, payload, 'Number');
            }
        },
        custom_date_fields: {
            __keys__: async (request, { payload }) => {
                return await (0, dynamic_fields_1.dynamicCustomFields)(request, payload, 'Date');
            }
        }
    },
    perform: async (request, { payload }) => {
        return await (0, utils_1.send)(request, [payload], false);
    },
    performBatch: async (request, { payload }) => {
        return await (0, utils_1.send)(request, payload, true);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map