"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const goal_1 = require("../goal");
const timestamp_1 = require("../timestamp");
const fields = { ...goal_1.defaultGoalFields };
const action = {
    title: 'Track Goal',
    description: 'Send a goal event to ABsmartly',
    fields: fields,
    defaultSubscription: 'type = "track" and event != "Experiment Viewed"',
    perform: (request, data) => {
        const requestData = data;
        const timestamp = (0, timestamp_1.unixTimestampOf)(requestData.rawData.timestamp);
        const payload = requestData.payload;
        const settings = requestData.settings;
        return (0, goal_1.sendGoal)(request, timestamp, payload, settings);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map