"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
const action = {
    title: 'Identify User',
    description: 'Upserts a user along with any traits to the Sprig platform.',
    fields: {
        userId: {
            description: 'The userId of the identified user.',
            label: 'User ID',
            required: true,
            type: 'string',
            default: {
                '@path': '$.userId'
            }
        },
        attributes: {
            description: 'The traits to attribute to the userId.',
            label: 'Attributes',
            required: false,
            type: 'object',
            default: {
                '@path': '$.traits'
            }
        }
    },
    perform: (request, data) => {
        return request('https://api.sprig.com/v2/users', {
            method: 'POST',
            headers: {
                Authorization: `Bearer ${data.settings.apiKey}`
            },
            json: (0, utils_1.payloadTransform)(data.payload)
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map