iachat/app/controllers/api/v1/accounts
Cayo P. R. Oliveira acd1e56a28 feat: baileys provider for whatsapp (#7)
* feat: baileys provider and placeholder for link device modal

* chore: drop qrcode.vue in favor of just img tag

* chore: update modal props

* feat: setup channel provider connection

* chore: update .env.example with Baileys API default configuration

* feat: add support for Baileys provider in WhatsApp events processing

* chore: rename Baileys API default host variable to DEFAULT_BAILEYS_URL

* feat: add setup and disconnect methods for Baileys channel provider in inboxes controller that will be implemented

* feat: add CHANNEL_CONNECTION_UPDATE event and include it in broadcast data preparation

* refactor: simplify channel retrieval logic in WhatsappEventsJob

* refactor: revert CHANNEL_UPDATE_EVENTS constant from ActionCableBroadcastJob

* feat: add 'baileys' as a provider option in Whatsapp channel model

* feat: add provider_connection field to Whatsapp channel model and migration

* refactor: remove unnecessary  CHANNEL_CONNECTION_UPDATE event type

* feat: implement channel provider connection with baileys API

* feat: add inbox association to Whatsapp channel model and update webhook URL handling

* feat: enhance Baileys service to handle webhook multiple event types

* refactor: simplify webhook verification logic in Baileys service

* feat: add setup channel provider call, and refactor some logic

* chore: adapt logic to new API

* refactor: fix typo

* refactor: fix import

* refactor: fix typo

* chore: add fixme comment about race condition

* fix: remove double disconnect call

* feat: implement message processing for incoming WhatsApp messages

* refactor: streamline message type determination and improve readability

* chore: increase cache key granularity

provider connection info might be updated multiple times within 1 second, so updates might be lost due to cache key not being updated. changing cache key to milliseconds solves this

* feat: add `is-loading` to buttons

* feat: update send_message method to use 'to' parameter and improve error handling

* refactor: simplify test setup and update API key in specs

* chore: add setup and disconnect channel provider specs

* test: fix spec after increase cache key granularity

* feat: handle reconnecting state on modal

* style: centered error text

* feat: advanced options on create inbox

* feat: handle new reconnecting on backend

* refactor: update inbox controller specs and leave a FIXME note

* test: add specs for Whatsapp::IncomingMessageBaileysService

* feat: add baileys configuration page

* feat: link device button when disconnected on conversation

* chore: refactor .env.example

* feat: add TODO for unimplemented methods in IncomingMessageBaileysService

* fix: correct method name and update environment variable references in WhatsappBaileysService

* refactor: simplify channel lookup by removing redundant method and handling phone number check directly

* chore: add TODO for unimplemented event processing methods in IncomingMessageBaileysService

* fix: update environment variable references in WhatsappBaileysService tests

* chore(webhook): add pt-BR translations

* chore: add pt-br translations

* chore: inboxname component margin

* refactor: inboxname computed prop

* feat: enhance WhatsApp provider connection handling and message processing

* test: inbox controller

* chore: improve baileys connection and messages handling

* test: incoming message service baileys

* refactor: update provider config validation and improve test setup for WhatsApp Baileys service

* fix: ensure only text messages are sent and update message source ID

* fix: create message

* fix: only update message on success

* test: fix broken specs

* chore: raise error on unsupported message content type

* feat: hide provider connection data from non-admins

* fix: update advanced options

* chore: move class definition

* fix: issue with send_message not returning id

---------

Co-authored-by: gabrieljablonski <contact@gabrieljablonski.com>
2025-04-03 23:28:38 -03:00
..
actions feat: Reverse the contact merge (#8057) 2023-10-10 08:20:48 +05:30
channels chore: Fix twilio inbox create transaction rollback (#9181) 2024-04-02 15:04:10 +05:30
contacts chore(refactor): Improve conversation permission filtering (#11166) 2025-03-31 19:30:02 -07:00
conversations chore: Fix issue with deleting interactive messages (#10123) 2024-09-16 21:05:39 -07:00
google feat: add Google login flow and inbox creation (#9580) 2024-06-07 16:37:46 +05:30
instagram feat: Added the ability to create Instagram channel (#11182) 2025-04-03 13:57:14 +05:30
integrations feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
microsoft feat: add Google login flow and inbox creation (#9580) 2024-06-07 16:37:46 +05:30
twitter fix: Twitter inbox creation error (#1783) 2021-02-16 19:35:10 +05:30
agent_bots_controller.rb chore: Adds API for agent bot avatar upload (#8533) 2023-12-11 19:02:11 -08:00
agents_controller.rb feat: Add APIs to manage custom roles in Chatwoot (#9995) 2024-08-23 17:18:28 +05:30
articles_controller.rb feat(v4): Update the help center portal design (#10296) 2024-10-23 22:09:36 -07:00
assignable_agents_controller.rb chore: Add Assignable Agents API (#4722) 2022-05-23 19:24:07 +05:30
automation_rules_controller.rb chore: lint files (#2) 2025-04-03 23:28:38 -03:00
base_controller.rb Feat: authenticate direct upload (#4160) 2022-03-16 13:54:18 +05:30
bulk_actions_controller.rb feat: Add support for bulk snooze until (#9360) 2024-05-08 08:55:31 +05:30
callbacks_controller.rb refactor: improve logging for channel callback controllers (#7555) 2023-07-27 17:10:39 +05:30
campaigns_controller.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
canned_responses_controller.rb fix: order for canned response (#6400) 2023-02-06 12:53:48 -08:00
categories_controller.rb feat: Adds the ability to set an emoji for help center category (#8111) 2023-10-20 13:52:30 +05:30
contact_inboxes_controller.rb chore: Add an API to find the contacts using contact inbox sourceId (#8012) 2023-09-28 15:26:28 -07:00
contacts_controller.rb feat: validate query conditions (#10595) 2024-12-17 17:16:37 +05:30
conversations_controller.rb chore(refactor): Improve conversation permission filtering (#11166) 2025-03-31 19:30:02 -07:00
csat_survey_responses_controller.rb feat: more CSAT filters (#7038) 2023-05-18 22:50:46 +05:30
custom_attribute_definitions_controller.rb feat: Support Regex validation for custom attributes (#7856) 2024-01-23 18:01:57 +04:00
custom_filters_controller.rb fix: set custom filter count in redis (#7164) 2023-06-19 16:10:03 +05:30
dashboard_apps_controller.rb feat: Allow users to create dashboard apps to give agents more context (#4761) 2022-06-01 11:13:10 +05:30
inbox_members_controller.rb feat: invalidate cache after inbox members or team members update (#10869) 2025-02-20 21:28:38 -08:00
inboxes_controller.rb feat: baileys provider for whatsapp (#7) 2025-04-03 23:28:38 -03:00
labels_controller.rb chore: Use "destroy!" instead of "destroy" when not checking the return value (#4259) 2022-03-24 13:28:25 +05:30
macros_controller.rb feat: common attachment endpoint follow-up changes (#7826) 2023-09-01 15:18:48 +07:00
notification_settings_controller.rb Chore: Code Cleanup in API controllers (#932) 2020-06-07 13:58:05 +05:30
notifications_controller.rb feat: Update last_snoozed_at after the un-snooze notification (#8943) 2024-02-20 18:55:39 +05:30
portals_controller.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
search_controller.rb feat: New APIs for search (#6564) 2023-02-28 22:00:36 +05:30
team_members_controller.rb feat: invalidate cache after inbox members or team members update (#10869) 2025-02-20 21:28:38 -08:00
teams_controller.rb chore: Use "destroy!" instead of "destroy" when not checking the return value (#4259) 2022-03-24 13:28:25 +05:30
upload_controller.rb feat: Extend upload API end point to support external images (#10062) 2024-09-05 10:42:54 +05:30
webhooks_controller.rb feat: webhook inbox (#5) 2025-04-03 23:28:38 -03:00
working_hours_controller.rb feat: Business hours 2020-11-01 00:14:33 +05:30