💬 Chat Blocks
Chat blocks provide comprehensive functionality for real-time communication in Nodeblocks applications. These blocks handle chat lifecycle operations including channels, messages, and subscriptions.
🎯 Overview
Chat blocks are designed to:
- Manage chat channels with full CRUD operations
- Handle message exchange and real-time communication
- Provide subscription management for notifications
- Support multi-channel communication
- Enable chat administration with comprehensive controls
📦 Block Types
🔍 Schemas
JSON Schema definitions for chat data validation:
- channelSchema: Base channel entity structure
- messageSchema: Message entity structure
- subscriptionSchema: Subscription entity structure
⚙️ Handlers
Core business logic for chat operations:
- Channel Operations: createChatChannel, getChatChannelById, findChatChannels, updateChatChannel, deleteChatChannel
- Message Operations: createChatMessage, getChatMessageById, findChatMessages, updateChatMessage, deleteChatMessage
- Subscription Operations: createChatSubscription, getChatSubscriptionById, findChatSubscriptions, deleteChatSubscription
🛣️ Routes
HTTP endpoint definitions for chat operations:
- Channel Routes: createChatChannelRoute, getChatChannelRoute, findChatChannelsRoute, updateChatChannelRoute, deleteChatChannelRoute
- Message Routes: createChatMessageRoute, getChatMessageRoute, findChatMessagesRoute, updateChatMessageRoute, deleteChatMessageRoute
- Subscription Routes: createChatSubscriptionRoute, getChatSubscriptionRoute, findChatSubscriptionsRoute, deleteChatSubscriptionRoute
🚀 Features
Composed chat features for easy integration:
- Channel Features: createChannelFeature, getChannelFeature, findChannelsFeature, updateChannelFeature, deleteChannelFeature
- Message Features: createChatMessageFeature, getChatMessageFeature, findChatMessagesFeature, updateChatMessageFeature, deleteChatMessageFeature
- Subscription Features: createChatSubscriptionFeature, getChatSubscriptionFeature, findChatSubscriptionsFeature, deleteChatSubscriptionFeature
✅ Validators
Validation functions for chat operations:
- validateChannelAccess: Validates channel access based on ownership and permissions
- validateMessageAccess: Validates message access based on ownership and permissions
🔗 Related Documentation
- Chat Schema Blocks - Chat data validation and contracts
- Chat Handler Blocks - Chat business logic functions
- Chat Route Blocks - Chat HTTP endpoint definitions
- Chat Feature Blocks - Complete chat feature documentation
- Chat Validator Blocks - Chat validation functions