"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
const action = {
    title: 'Post Event',
    description: 'Post a user event to IQM',
    defaultSubscription: 'type = "track"',
    fields: {
        data: {
            label: 'Data',
            type: 'object',
            required: false,
            description: 'The data to be sent to IQM',
            default: {
                '@path': '$.'
            }
        }
    },
    perform: (request, { settings, payload }) => {
        const { pixel_id } = settings;
        return request(`${__1.BASE_URL}&pixel_id=${pixel_id}`, {
            method: 'post',
            headers: { HOST: 'postback.iqm.com', 'Content-Type': 'application/json' },
            body: JSON.stringify(payload)
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map