"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const common_fields_1 = require("../common-fields");
const utils_1 = require("../utils");
const action = {
    title: 'Page',
    description: 'Send page events to Accoil',
    defaultSubscription: 'type = "page"',
    fields: {
        userId: {
            type: 'string',
            description: 'The ID associated with the user',
            label: 'User ID',
            default: { '@path': '$.userId' }
        },
        name: {
            type: 'string',
            required: false,
            description: 'The name of the page',
            label: 'Page Name',
            default: { '@path': '$.name' }
        },
        timestamp: common_fields_1.commonFields.timestamp
    },
    perform: (request, { payload, settings }) => {
        return request((0, utils_1.endpointUrl)(settings.api_key), {
            method: 'post',
            json: {
                type: 'page',
                userId: payload.userId,
                name: payload.name,
                timestamp: payload.timestamp
            }
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map