"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.demo = void 0;
const dataPoints = {
    eventType: {
        key: 'eventType',
        valueType: 'string',
    },
    hello: {
        key: 'webhookDataPoint',
        valueType: 'string',
    },
    a_string: {
        key: 'a_string',
        valueType: 'string',
    },
    a_number: {
        key: 'a_number',
        valueType: 'number',
    },
    a_boolean: {
        key: 'a_boolean',
        valueType: 'boolean',
    },
    a_date: {
        key: 'a_date',
        valueType: 'date',
    },
    a_phone: {
        key: 'a_phone',
        valueType: 'telephone',
    },
    a_json: {
        key: 'a_json',
        valueType: 'json',
    },
};
exports.demo = {
    key: 'demo',
    dataPoints,
    onWebhookReceived: async ({ payload }, onSuccess, onError) => {
        const { eventType, hello, a_string, a_number, a_boolean, a_date, a_phone, a_json, patient_id, } = payload;
        await onSuccess({
            data_points: {
                eventType,
                hello,
                a_string,
                a_number: String(a_number),
                a_boolean: String(a_boolean),
                a_date,
                a_phone,
                a_json: JSON.stringify(a_json),
            },
            ...(patient_id ? { patient_id } : {}),
        });
    },
};
//# sourceMappingURL=demo.js.map