const action = {
    title: 'Identify',
    description: 'Identify user in Ripe',
    defaultSubscription: 'type = "identify"',
    platform: 'web',
    fields: {
        anonymousId: {
            type: 'string',
            required: true,
            description: 'The anonymous id',
            label: 'Anonymous ID',
            default: { '@path': '$.anonymousId' }
        },
        userId: {
            type: 'string',
            required: false,
            description: 'The ID associated with the user',
            label: 'User ID',
            default: { '@path': '$.userId' }
        },
        groupId: {
            type: 'string',
            required: false,
            description: 'The ID associated groupId',
            label: 'Group ID',
            default: { '@path': '$.context.groupId' }
        },
        traits: {
            type: 'object',
            label: 'Traits',
            description: 'Traits to associate with the user',
            required: false,
            default: { '@path': '$.traits' }
        }
    },
    perform: async (ripe, { payload }) => {
        console.log(JSON.stringify(payload, null, 2));
        await ripe.setIds(payload.anonymousId, payload.userId, payload.groupId);
        return ripe.identify(payload.anonymousId, payload.userId, payload.traits);
    }
};
export default action;
//# sourceMappingURL=index.js.map