"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.actionDefinition = void 0;
const apiLookups_1 = require("./apiLookups");
exports.actionDefinition = {
    title: 'Perform a single API lookup',
    description: 'Perform a single API lookup and return the response',
    fields: {
        ...apiLookups_1.apiLookupActionFields,
        traits: {
            label: 'Traits',
            description: "A user profile's traits",
            type: 'object',
            required: false
        }
    },
    perform: async (request, { settings, payload, statsContext, logger }) => {
        const statsClient = statsContext?.statsClient;
        const tags = statsContext?.tags ?? [];
        const { traits = {}, ...apiLookupConfig } = payload;
        const profile = { traits: traits };
        const data = await (0, apiLookups_1.performApiLookup)(request, apiLookupConfig, profile, statsClient, tags, settings, logger);
        return {
            data
        };
    }
};
exports.default = exports.actionDefinition;
//# sourceMappingURL=index.js.map