"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const userFields_1 = require("../fields/userFields");
const routes_1 = require("../routes");
const action = {
    title: 'Save User',
    description: 'Send a customer to Angler.',
    fields: {
        ...userFields_1.userFields
    },
    perform: (request, data) => {
        const { user: userFields, ...payloadFields } = data.payload;
        const payload = {
            src: 'SEGMENT',
            data: [{ ...userFields, ...payloadFields }]
        };
        return request(routes_1.baseURL + (0, routes_1.customersEndpoint)(data.settings.workspaceId), {
            method: 'post',
            json: payload
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map