const action = {
    title: 'Track Event',
    description: "Submit an event's properties as CommandBar metaData.",
    platform: 'web',
    defaultSubscription: 'type = "track"',
    fields: {
        event_name: {
            description: 'The name of the event.',
            label: 'Event Name',
            type: 'string',
            required: true,
            default: {
                '@path': '$.event'
            }
        },
        event_metadata: {
            description: 'Optional metadata describing the event.',
            label: 'Event Metadata',
            type: 'object',
            required: false,
            default: {
                '@path': '$.properties'
            }
        }
    },
    perform: (CommandBar, event) => {
        if (event.payload.event_name) {
            CommandBar.trackEvent(event.payload.event_name, event.payload.event_metadata || {});
        }
    }
};
export default action;
//# sourceMappingURL=index.js.map