"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.videoIdMapping = exports.ecommerceIdMapping = void 0;
exports.interactionFields = interactionFields;
function interactionFields(interactionName) {
    return {
        recommId: {
            label: 'Recommendation ID',
            description: `The ID of the clicked recommendation (if the ${interactionName} is based on a recommendation request).`,
            type: 'string',
            required: false,
            default: {
                '@path': '$.properties.recomm_id'
            }
        },
        internalAdditionalData: {
            label: 'Internal Additional Data',
            description: `Internal additional data to be stored with the ${interactionName}.`,
            type: 'object',
            defaultObjectUI: 'keyvalue:only',
            readOnly: true,
            unsafe_hidden: true,
            default: {
                segmentEventType: {
                    '@path': '$.type'
                },
                segmentEventName: {
                    '@if': {
                        exists: { '@path': '$.event' },
                        then: { '@path': '$.event' },
                        else: { '@path': '$.name' }
                    }
                }
            }
        },
        additionalData: {
            label: 'Additional Data',
            description: `Additional data to be stored with the ${interactionName}. *Keep this field empty unless instructed by the Recombee Support team.*`,
            type: 'object',
            required: false,
            defaultObjectUI: 'keyvalue:only'
        }
    };
}
exports.ecommerceIdMapping = {
    itemId: {
        '@if': {
            exists: { '@path': '$.properties.product_id' },
            then: { '@path': '$.properties.product_id' },
            else: { '@path': '$.properties.sku' }
        }
    }
};
exports.videoIdMapping = {
    itemId: {
        '@if': {
            exists: { '@path': '$.properties.content_asset_id' },
            then: { '@path': '$.properties.content_asset_id' },
            else: { '@path': '$.properties.content_asset_ids[0]' }
        }
    }
};
//# sourceMappingURL=commonFields.js.map