"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fields_1 = require("../fields");
const constants_1 = require("../constants");
const functions_1 = require("../functions");
const action = {
    title: 'Upsert Custom Attributes',
    description: 'Upserts custom attributes on a user profile in Attentive.',
    defaultSubscription: 'type = "identify"',
    fields: {
        userIdentifiers: fields_1.userIdentifiers,
        properties: {
            ...fields_1.properties,
            default: {
                '@path': '$.traits'
            },
            required: true
        }
    },
    perform: (request, { payload }) => {
        (0, functions_1.validate)(payload);
        return request(`${constants_1.API_URL}/${constants_1.API_VERSION}/attributes/custom`, {
            method: 'post',
            json: (0, functions_1.formatUpsertUserAttributesJSON)(payload)
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map