<?php
if (!defined('ABSPATH')) {
    exit;
}

/**
 * Webhook Events Registry
 *
 * Defines the canonical list of webhook event names.
 *
 * @package    Kitsune_AI_Platform
 * @subpackage Kitsune_AI_Platform/includes
 */

class Kitsune_AI_Platform_Webhook_Events {

    // Fires when a chatbot is created via the admin UI or API.
    const CHATBOT_CREATED = 'chatbot.created';

    // Fires when a chatbot is updated via the admin UI or API.
    const CHATBOT_UPDATED = 'chatbot.updated';

    // Fires when a chatbot is deleted via the admin UI or API.
    const CHATBOT_DELETED = 'chatbot.deleted';

    // Fires when a new conversation is created for a chatbot.
    const CONVERSATION_CREATED = 'conversation.created';

    // Fires when a new message is added to a conversation.
    const CONVERSATION_MESSAGE_CREATED = 'conversation.message.created';

    // Fires when content is generated from the Content Studio.
    const CONTENT_GENERATED = 'content.generated';

    // Fires when generated content is saved as a WordPress draft.
    const CONTENT_SAVED = 'content.saved';

    // Fires when an AI form is created.
    const FORM_CREATED = 'form.created';

    // Fires when an AI form is updated.
    const FORM_UPDATED = 'form.updated';

    // Fires when an AI form is deleted.
    const FORM_DELETED = 'form.deleted';

    // Fires when a workflow is created.
    const WORKFLOW_CREATED = 'workflow.created';

    // Fires when a workflow is updated.
    const WORKFLOW_UPDATED = 'workflow.updated';

    // Fires when a workflow is deleted.
    const WORKFLOW_DELETED = 'workflow.deleted';

    // Fires when a workflow is executed manually or by schedule.
    const WORKFLOW_EXECUTED = 'workflow.executed';

    // Fires when an integration is connected.
    const INTEGRATION_CONNECTED = 'integration.connected';

    // Fires when an integration is disconnected.
    const INTEGRATION_DISCONNECTED = 'integration.disconnected';

    public static function all() {
        return array(
            self::CHATBOT_CREATED,
            self::CHATBOT_UPDATED,
            self::CHATBOT_DELETED,
            self::CONVERSATION_CREATED,
            self::CONVERSATION_MESSAGE_CREATED,
            self::CONTENT_GENERATED,
            self::CONTENT_SAVED,
            self::FORM_CREATED,
            self::FORM_UPDATED,
            self::FORM_DELETED,
            self::WORKFLOW_CREATED,
            self::WORKFLOW_UPDATED,
            self::WORKFLOW_DELETED,
            self::WORKFLOW_EXECUTED,
            self::INTEGRATION_CONNECTED,
            self::INTEGRATION_DISCONNECTED,
        );
    }
}
