"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const productListViewedEvent_1 = __importDefault(require("./productListViewedEvent"));
const productViewedEvent_1 = __importDefault(require("./productViewedEvent"));
const updateUserProfile_1 = __importDefault(require("./updateUserProfile"));
const productAddedEvent_1 = __importDefault(require("./productAddedEvent"));
const productRemovedEvent_1 = __importDefault(require("./productRemovedEvent"));
const userRegisteredEvent_1 = __importDefault(require("./userRegisteredEvent"));
const cartViewedEvent_1 = __importDefault(require("./cartViewedEvent"));
const checkoutEvent_1 = __importDefault(require("./checkoutEvent"));
const orderCompletedEvent_1 = __importDefault(require("./orderCompletedEvent"));
const trackEvent_1 = __importDefault(require("./trackEvent"));
const actions_core_1 = require("@segment/actions-core");
const presets = [
    {
        name: 'Create or Update a User Profile',
        subscribe: 'type = "identify"',
        partnerAction: 'updateUserProfile',
        mapping: (0, actions_core_1.defaultValues)(updateUserProfile_1.default.fields),
        type: 'automatic'
    }
];
const destination = {
    name: 'Insider Cloud Mode (Actions)',
    slug: 'actions-insider-cloud',
    mode: 'cloud',
    authentication: {
        scheme: 'custom',
        fields: {
            account_name: {
                label: 'Account Name',
                description: 'You can get your Account Name via Insider Inone Panel > Settings > Inone Settings > Account Preferences.',
                type: 'string',
                required: true
            },
            ucd_key: {
                label: 'API Key',
                description: 'You can get your API Key via Insider Inone Panel > Settings > Preferences > Integration Settings',
                type: 'password',
                required: true
            }
        }
    },
    extendRequest: ({ settings }) => {
        return {
            headers: {
                'X-PLATFORM-NAME': 'segment',
                'X-PARTNER-NAME': settings.account_name,
                'X-REQUEST-TOKEN': settings.ucd_key
            }
        };
    },
    presets,
    actions: {
        updateUserProfile: updateUserProfile_1.default,
        trackEvent: trackEvent_1.default,
        productListViewedEvent: productListViewedEvent_1.default,
        productViewedEvent: productViewedEvent_1.default,
        productAddedEvent: productAddedEvent_1.default,
        productRemovedEvent: productRemovedEvent_1.default,
        userRegisteredEvent: userRegisteredEvent_1.default,
        cartViewedEvent: cartViewedEvent_1.default,
        checkoutEvent: checkoutEvent_1.default,
        orderCompletedEvent: orderCompletedEvent_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map