"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const action = {
    title: 'Identify',
    description: 'Identify user in Prodeology',
    defaultSubscription: 'type = "identify"',
    fields: {
        anonymousId: {
            type: 'string',
            description: 'An anonymous identifier',
            label: 'Anonymous ID',
            default: { '@path': '$.anonymousId' }
        },
        userId: {
            type: 'string',
            description: 'The ID associated with the user',
            label: 'User ID',
            default: { '@path': '$.userId' }
        },
        traits: {
            type: 'object',
            label: 'Traits',
            description: 'Traits to associate with the user',
            required: false,
            default: { '@path': '$.traits' }
        },
        timestamp: {
            type: 'string',
            format: 'date-time',
            required: true,
            description: 'The timestamp of the event',
            label: 'Timestamp',
            default: { '@path': '$.timestamp' }
        },
        messageId: {
            type: 'string',
            required: true,
            description: 'The Segment messageId',
            label: 'MessageId',
            default: { '@path': '$.messageId' }
        }
    },
    perform: (request, { payload }) => {
        return request('https://api-dev.prodeology.com/api/v1/event-collection/identify', {
            method: 'post',
            json: {
                anonymousId: payload.anonymousId,
                userId: payload.userId,
                traits: payload.traits,
                messageId: payload.messageId,
                timestamp: payload.timestamp
            }
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map