"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const action = {
    title: 'Identify User',
    description: 'Send the identify event to create or update the customer in rehook.',
    defaultSubscription: 'type = "identify"',
    fields: {
        source_id: {
            label: 'Source ID',
            type: 'string',
            required: true,
            description: 'The unique user identifier set by you',
            default: {
                '@path': '$.userId'
            }
        },
        metadata: {
            label: 'User Metadata',
            type: 'object',
            required: false,
            description: 'Properties to set on the user profile',
            default: {
                '@path': '$.traits'
            }
        },
        referral_code: {
            label: 'Referral Code',
            type: 'string',
            allowNull: true,
            description: 'The referral code of the user',
            default: {
                '@path': '$.traits.referral_code'
            }
        }
    },
    perform: async (request, { payload }) => {
        return request('https://api.rehook.ai/customers', {
            method: 'post',
            json: payload
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map