"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const cordial_client_1 = __importDefault(require("../cordial-client"));
const action = {
    title: 'Merge Contacts',
    description: 'Merge contacts in Cordial.',
    defaultSubscription: 'type = "alias"',
    fields: {
        segmentId: {
            label: 'New Segment User ID',
            description: 'New Segment User ID value',
            type: 'string',
            required: false,
            default: { '@path': '$.userId' }
        },
        anonymousId: {
            label: 'New Segment Anonymous ID',
            description: 'New Segment Anonymous ID value',
            type: 'string',
            required: false,
            default: { '@path': '$.anonymousId' }
        },
        previousId: {
            label: 'Previous Segment ID',
            description: 'Previous Segment User or Anonymous ID value',
            type: 'string',
            required: true,
            default: { '@path': '$.previousId' }
        }
    },
    perform: async (request, { settings, payload }) => {
        const client = new cordial_client_1.default(settings, request);
        return client.mergeContacts(payload);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map