"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fields_1 = require("../fields");
const utils_1 = require("../utils");
const action = {
    title: 'Track Event',
    description: 'Track a single event in Altertable.',
    defaultSubscription: 'type = "track"',
    fields: {
        event: {
            label: 'Event Name',
            description: 'The name of the event to track.',
            type: 'string',
            default: {
                '@path': '$.event'
            },
            required: true
        },
        properties: {
            label: 'Properties',
            description: 'The properties of the event',
            type: 'object',
            required: true,
            default: {
                '@path': '$.properties'
            }
        },
        ...fields_1.commonFields,
        enable_batching: {
            label: 'Enable Batching',
            type: 'boolean',
            required: true,
            default: true,
            unsafe_hidden: true,
            description: 'When enabled, events are sent in batches to Altertable.'
        },
        batch_size: {
            label: 'Batch Size',
            type: 'number',
            required: false,
            default: 1000,
            unsafe_hidden: true,
            description: 'Maximum number of events per batch request.'
        },
        batch_bytes: {
            label: 'Batch Bytes',
            type: 'number',
            required: false,
            default: 4000000,
            unsafe_hidden: true,
            description: 'Maximum batch payload size in bytes.'
        }
    },
    perform: (request, { settings, payload }) => {
        return (0, utils_1.sendTrack)(request, settings, payload);
    },
    performBatch: (request, { settings, payload }) => {
        return (0, utils_1.sendTrackBatch)(request, settings, payload);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map