"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sfmc_properties_1 = require("../sfmc-properties");
const sfmc_operations_1 = require("../sfmc-operations");
const action = {
    title: 'Send Event to Data Extension',
    description: 'Upsert events as rows into an existing data extension in Salesforce Marketing Cloud.',
    fields: {
        key: sfmc_properties_1.key,
        id: sfmc_properties_1.id,
        keys: { ...sfmc_properties_1.keys, required: true },
        values: sfmc_properties_1.values_dataExtensionFields,
        enable_batching: sfmc_properties_1.enable_batching,
        batch_size: sfmc_properties_1.batch_size
    },
    perform: async (request, { settings, payload }) => {
        return (0, sfmc_operations_1.upsertRows)(request, settings.subdomain, [payload]);
    },
    performBatch: async (request, { settings, payload, statsContext }) => {
        return (0, sfmc_operations_1.executeUpsertWithMultiStatus)(request, settings.subdomain, payload, undefined, statsContext);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map