iachat/app/policies
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
..
account_policy.rb feat: Ability to delete account for administrators (#1874) 2025-04-03 10:41:39 +05:30
agent_bot_policy.rb chore: Adds API for agent bot avatar upload (#8533) 2023-12-11 19:02:11 -08:00
application_policy.rb chore: Update dependencies (#1173) 2020-09-08 11:24:08 +05:30
article_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
automation_rule_policy.rb feat: common attachment endpoint follow-up changes (#7826) 2023-09-01 15:18:48 +07:00
campaign_policy.rb feat: Add APIs for Campaigns (#2175) 2021-04-29 22:23:32 +05:30
category_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
contact_policy.rb feat: Contact Exports (#7258) 2023-06-13 09:18:43 +05:30
conversation_policy.rb chore: Ensure privilege validations for API endpoints (#2224) 2021-06-11 11:44:31 +05:30
csat_survey_response_policy.rb chore: Add an option to download CSAT Reports (#4694) 2022-05-17 21:01:45 +05:30
custom_filter_policy.rb fix: set custom filter count in redis (#7164) 2023-06-19 16:10:03 +05:30
hook_policy.rb feat: Ability to improve drafts in the editor using GPT integration (#6957) 2023-04-24 23:52:23 +05:30
inbox_policy.rb feat: baileys provider for whatsapp (#7) 2025-04-03 23:28:38 -03:00
label_policy.rb Feature: Improve label experience (#975) 2020-06-25 21:04:03 +05:30
macro_policy.rb feat: common attachment endpoint follow-up changes (#7826) 2023-09-01 15:18:48 +07:00
portal_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
report_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
team_member_policy.rb chore: Update method for team members (#1734) 2021-02-09 19:21:31 +05:30
team_policy.rb feat: Team APIs (#1654) 2021-01-17 23:56:56 +05:30
user_policy.rb feat: allow bulk invite create via email (#8853) 2024-02-06 09:04:04 +05:30
webhook_policy.rb Feature: Ability to switch between multiple accounts (#881) 2020-05-26 22:38:48 +05:30