"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fields_1 = require("../fields");
const utils_1 = require("../utils");
const action = {
    title: 'Alias',
    description: 'Link a previous anonymous or temporary ID to a user ID in Altertable.',
    defaultSubscription: 'type = "alias"',
    fields: {
        previousId: {
            label: 'Previous ID',
            description: 'The previous user identifier (maps to distinct_id in the Altertable API).',
            type: 'string',
            required: true,
            default: {
                '@path': '$.previousId'
            }
        },
        ...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.sendAlias)(request, settings, payload);
    },
    performBatch: (request, { settings, payload }) => {
        return (0, utils_1.sendAliasBatch)(request, settings, payload);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map