"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const actions_core_1 = require("@segment/actions-core");
const track_1 = __importDefault(require("./track"));
const page_1 = __importDefault(require("./page"));
const presets = [
    {
        name: 'Order Completed Calls',
        subscribe: 'type = "track" and event = "Order Completed"',
        partnerAction: 'track',
        mapping: {
            ...(0, actions_core_1.defaultValues)(track_1.default.fields),
            podscribeEvent: 'purchase'
        },
        type: 'automatic'
    },
    {
        name: 'Signed Up Calls',
        subscribe: 'type = "track" and event = "Signed Up"',
        partnerAction: 'track',
        mapping: {
            ...(0, actions_core_1.defaultValues)(track_1.default.fields),
            podscribeEvent: 'signup'
        },
        type: 'automatic'
    },
    {
        name: 'Page Calls',
        subscribe: 'type = "page"',
        partnerAction: 'page',
        mapping: (0, actions_core_1.defaultValues)(page_1.default.fields),
        type: 'automatic'
    }
];
const destination = {
    name: 'Podscribe (Actions)',
    slug: 'actions-podscribe',
    mode: 'cloud',
    authentication: {
        scheme: 'custom',
        fields: {
            advertiser: {
                label: 'Advertiser',
                description: 'Podscribe advertiser lookup key',
                type: 'string',
                required: true
            },
            userId: {
                label: 'User ID',
                description: 'Podscribe user ID',
                type: 'string',
                required: false
            }
        }
    },
    presets,
    actions: {
        track: track_1.default,
        page: page_1.default
    }
};
exports.default = destination;
//# sourceMappingURL=index.js.map