"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const cordial_client_1 = __importDefault(require("../cordial-client"));
const identities_fields_1 = __importDefault(require("../identities-fields"));
const action = {
    title: 'Remove Product from Cart',
    description: 'Removes product from Cordial contact cart',
    defaultSubscription: 'type = "track" and event = "Product Removed"',
    fields: {
        ...identities_fields_1.default,
        productID: {
            label: 'Product ID',
            description: 'Internal identifier of a product',
            type: 'string',
            required: true,
            default: {
                '@path': '$.properties.product_id'
            }
        },
        qty: {
            label: 'Quantity',
            description: 'Quantity of a product',
            type: 'integer',
            required: true,
            default: {
                '@path': '$.properties.quantity'
            }
        }
    },
    perform: (request, { settings, payload }) => {
        const client = new cordial_client_1.default(settings, request);
        return client.removeProductFromCart(payload);
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map