"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const functions_1 = require("./functions");
const fields_1 = require("./fields");
const action = {
    title: 'Sync Audience',
    description: 'Sync Segment Engage audience and user profile details to StackAdapt',
    defaultSubscription: 'type = "identify" or type = "track"',
    fields: {
        ...fields_1.profile_fields,
        ...fields_1.audience_only_fields,
        email: {
            label: 'Email',
            description: 'The email address of the user.',
            type: 'string',
            format: 'email',
            required: true,
            default: {
                '@if': {
                    exists: { '@path': '$.traits.email' },
                    then: { '@path': '$.traits.email' },
                    else: { '@path': '$.properties.email' }
                }
            }
        }
    },
    perform: async (request, { payload, settings }) => {
        return await (0, functions_1.send)(request, [payload], settings);
    },
    performBatch: async (request, { payload, settings }) => {
        return await (0, functions_1.send)(request, payload, settings);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map