"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const insider_properties_1 = require("../insider-properties");
const insider_helpers_1 = require("../insider-helpers");
const action = {
    title: 'Product Removed Event',
    description: 'Record Product Removed Event to Insider',
    defaultSubscription: 'type = "track" and event = "Product Removed"',
    fields: {
        email_as_identifier: { ...insider_properties_1.email_as_identifier },
        phone_number_as_identifier: { ...insider_properties_1.phone_number_as_identifier },
        append_arrays: { ...insider_properties_1.append_arrays },
        uuid: { ...insider_properties_1.uuid },
        segment_anonymous_id: { ...insider_properties_1.segment_anonymous_id },
        custom_identifiers: { ...insider_properties_1.custom_identifiers },
        timestamp: { ...insider_properties_1.timestamp },
        parameters: {
            ...(0, insider_properties_1.getEventParameteres)([
                'taxonomy',
                'url',
                'currency',
                'unit_price',
                'unit_sale_price',
                'referrer',
                'product_id',
                'name',
                'product_image_url',
                'quantity'
            ])
        },
        attributes: { ...insider_properties_1.user_attributes }
    },
    perform: (request, data) => {
        return request(`${insider_helpers_1.API_BASE}${insider_helpers_1.UPSERT_ENDPOINT}`, {
            method: 'post',
            json: (0, insider_helpers_1.sendTrackEvent)(data.payload, 'item_removed_from_cart')
        });
    },
    performBatch: (request, data) => {
        return request(`${insider_helpers_1.API_BASE}${insider_helpers_1.UPSERT_ENDPOINT}`, {
            method: 'post',
            json: (0, insider_helpers_1.sendBulkTrackEvents)(data.payload, 'item_removed_from_cart')
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map