"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.retlHookOutputTypes = exports.retlHookInputFields = exports.fields = void 0;
const hook_functions_1 = require("./hook-functions");
exports.fields = {
    externalId: {
        type: 'string',
        required: true,
        label: 'External ID',
        category: 'hashedPII',
        description: 'Your company’s custom identifier for this user. This can be any unique ID, such as loyalty membership IDs, user IDs, and external cookie IDs.',
        default: { '@path': '$.userId' }
    },
    email: {
        type: 'string',
        label: 'Email',
        description: 'User’s email (ex: foo@bar.com)',
        category: 'hashedPII',
        default: {
            '@if': {
                exists: { '@path': '$.traits.email' },
                then: { '@path': '$.traits.email' },
                else: { '@path': '$.properties.email' }
            }
        }
    },
    phone: {
        type: 'string',
        label: 'Phone',
        description: 'User’s phone number, including country code. Punctuation and spaces are ok (ex: 1-234-567-8910 or +44 844 412 4653)',
        category: 'hashedPII',
        default: {
            '@if': {
                exists: { '@path': '$.traits.phone' },
                then: { '@path': '$.traits.phone' },
                else: { '@path': '$.properties.phone' }
            }
        }
    },
    birth: {
        type: 'object',
        label: 'Date of Birth',
        description: 'User’s date of birth. Include as many fields as possible for better match rates (ex: year = YYYY, month = MM, day = DD)',
        defaultObjectUI: 'keyvalue',
        properties: {
            year: {
                type: 'string',
                label: 'Year'
            },
            month: {
                type: 'string',
                label: 'Month'
            },
            day: {
                type: 'string',
                label: 'Day'
            }
        },
        category: 'hashedPII'
    },
    name: {
        type: 'object',
        label: 'Name',
        description: 'User’s name. Include as many fields as possible for better match rates. Use a-z only. No punctuation. Special characters in UTF-8 format',
        category: 'hashedPII',
        defaultObjectUI: 'keyvalue',
        properties: {
            first: {
                type: 'string',
                label: 'First Name',
                category: 'hashedPII'
            },
            last: {
                type: 'string',
                label: 'Last Name',
                category: 'hashedPII'
            },
            firstInitial: {
                type: 'string',
                label: 'First Initial'
            }
        },
        default: {
            first: {
                '@if': {
                    exists: { '@path': '$.traits.first_name' },
                    then: { '@path': '$.traits.first_name' },
                    else: { '@path': '$.properties.first_name' }
                }
            },
            last: {
                '@if': {
                    exists: { '@path': '$.traits.last_name' },
                    then: { '@path': '$.traits.last_name' },
                    else: { '@path': '$.properties.last_name' }
                }
            }
        }
    },
    gender: {
        type: 'string',
        label: 'Gender',
        description: 'User’s gender (m for male, f for female)',
        category: 'hashedPII',
        default: {
            '@if': {
                exists: { '@path': '$.traits.gender' },
                then: { '@path': '$.traits.gender' },
                else: { '@path': '$.properties.gender' }
            }
        }
    },
    city: {
        type: 'string',
        label: 'City',
        description: 'User’s city. Use a-z only. No punctuation. No special characters.',
        category: 'hashedPII',
        default: {
            '@if': {
                exists: { '@path': '$.traits.city' },
                then: { '@path': '$.traits.city' },
                else: { '@path': '$.properties.city' }
            }
        }
    },
    state: {
        type: 'string',
        label: 'State',
        description: 'User’s state. Use the 2-character ANSI abbreviation code, Normalize states outside the US with no punctuation and no special characters.',
        category: 'hashedPII',
        default: {
            '@if': {
                exists: { '@path': '$.traits.state' },
                then: { '@path': '$.traits.state' },
                else: { '@path': '$.properties.state' }
            }
        }
    },
    zip: {
        type: 'string',
        label: 'Postal Code',
        description: 'User’s postal code. For the US, use only the first 5 digits. For the UK, use the Area/District/Sector format.',
        category: 'hashedPII',
        default: {
            '@if': {
                exists: { '@path': '$.traits.postal_code' },
                then: { '@path': '$.traits.postal_code' },
                else: { '@path': '$.properties.postal_code' }
            }
        }
    },
    country: {
        type: 'string',
        label: 'Country',
        description: 'User’s country. Use 2-letter country codes in ISO 3166-1 alpha-2 format.',
        category: 'hashedPII',
        default: {
            '@if': {
                exists: { '@path': '$.traits.country' },
                then: { '@path': '$.traits.country' },
                else: { '@path': '$.properties.country' }
            }
        }
    },
    mobileAdId: {
        type: 'string',
        label: 'Mobile Advertising ID',
        description: 'User’s Apple IDFA, Android Ad ID, or Facebook app scoped ID. Keep hyphens (ex: AB1234CD-E123-12FG-J123)',
        category: 'hashedPII'
    },
    appId: {
        type: 'string',
        label: 'App ID',
        description: 'The app ID of the user.',
        category: 'hashedPII'
    },
    pageId: {
        type: 'string',
        label: 'Page ID',
        description: 'The page ID of the user.',
        category: 'hashedPII'
    },
    igAccountIds: {
        type: 'string',
        label: 'Instagram Account IDs',
        description: 'The Instagram account ID of the user.'
    },
    external_audience_id: {
        label: 'Facebook List ID',
        description: `The ID representing the Facebook identifier. This is the identifier that is returned during audience creation.'`,
        type: 'string',
        default: {
            '@path': '$.context.personas.external_audience_id'
        },
        unsafe_hidden: true
    },
    enable_batching: {
        label: 'Enable Batching',
        description: 'Enable batching of requests.',
        type: 'boolean',
        default: true,
        unsafe_hidden: true,
        required: true
    },
    batch_size: {
        label: 'Batch Size',
        description: 'Maximum number of events to include in each batch. Actual batch sizes may be lower.',
        type: 'number',
        default: 10000,
        unsafe_hidden: true,
        required: true
    }
};
exports.retlHookInputFields = {
    operation: {
        type: 'string',
        label: 'Create a new custom audience or connect to an existing one?',
        description: 'Choose to either create a new custom audience or use an existing one. If you opt to create a new audience, we will display the required fields for audience creation. If you opt to use an existing audience, a drop-down menu will appear, allowing you to select from all the custom audiences in your ad account.',
        choices: [
            { label: 'Create New Audience', value: 'create' },
            { label: 'Connect to Existing Audience', value: 'existing' }
        ],
        default: 'create'
    },
    audienceName: {
        type: 'string',
        label: 'Audience Creation Name',
        description: 'The name of the audience in Facebook.',
        depends_on: {
            conditions: [
                {
                    fieldKey: 'operation',
                    operator: 'is',
                    value: 'create'
                }
            ]
        }
    },
    existingAudienceId: {
        type: 'string',
        label: 'Existing Audience ID',
        description: 'The ID of the audience in Facebook.',
        depends_on: {
            conditions: [
                {
                    fieldKey: 'operation',
                    operator: 'is',
                    value: 'existing'
                }
            ]
        },
        dynamic: hook_functions_1.getExistingAudienceIdChoices
    }
};
exports.retlHookOutputTypes = {
    audienceName: {
        type: 'string',
        label: 'Audience Name',
        description: 'The name of the audience in Facebook this mapping is connected to.',
        required: true
    },
    audienceId: {
        type: 'string',
        label: 'Audience ID',
        description: 'The ID of the audience in Facebook.',
        required: true
    }
};
//# sourceMappingURL=fields.js.map