{ "version":"2.2.0","name":"Join IRC Channel","description":"Add user to IRC channel with membership tracking","trigger":{"type":"http","method":"POST","path":"/irc/channels/:channelId/join"},"nodes":[{"id":"validate_context","type":"operation","op":"validate","input":"{{ $context.user.id }}","validator":"required"},{"id":"fetch_channel","type":"operation","op":"database_read","entity":"IRCChannel","params":{"filter":{"id":"{{ $json.channelId }}","tenantId":"{{ $context.tenantId }}"}}},{"id":"check_channel_mode","type":"operation","op":"condition","condition":"{{ $steps.fetch_channel.output.mode === 'public' || ($context.user.level >= 2 && $steps.fetch_channel.output.mode === 'private') }}"},{"id":"create_membership","type":"operation","op":"database_create","entity":"IRCMembership","data":{"channelId":"{{ $json.channelId }}","userId":"{{ $context.user.id }}","joinedAt":"{{ new Date().toISOString() }}"}},{"id":"emit_join","type":"action","action":"emit_event","event":"user_joined","channel":"{{ 'irc:' + $json.channelId }}","data":{"userId":"{{ $context.user.id }}","channelId":"{{ $json.channelId }}"}}] }