feat(evohub): canal EvoHub na criação de instância (Fase 1)#29
Merged
Conversation
Releases the license-aware manager-v2 alongside Evolution API v2.4.0: - evolution-go provider support + design-system refactor + i18n - Sessions* features ported from #14 - React port of the interactive-message tester - Branding updates to Evolution Foundation domains - License-aware login flow (Phase 2 of the licensing rollout)
Adiciona EvoHub como 4ª opção de canal no NewInstance (manager-v2), Fase 1 =
vincular canal existente. Os 3 canais existentes ficam idênticos.
- evolution.types.ts: shapes Hub (HubPlan, MetaAppOptions, HubChannel,
EvoHubProvisionResponse) + EVOHUB_INTEGRATION + tipos de canal
- i18n: chave integration.evohub + bloco instance.form.evohub.* nos 4 idiomas
- NewInstance.tsx: EVOHUB no enum Zod + options + render condicional
<EvoHubConnect/>; esconde o Save global no EVOHUB (evita double-create)
- evohubService.ts: serviço control-plane via apiGlobal (apikey global);
linkExisting (Fase 1) envia só { instanceName, hub_channel_id, channel_type },
token resolvido server-side — o front nunca vê o token
- EvoHubConnect.tsx: painel de conexão; Fase 1 = modo existing (single-step,
estado linked legítimo). Modo new (public_link) atrás de flag PHASE2_CREATE_NEW
tsc --noEmit verde, eslint limpo. (build tsc -b acusa erro PRÉ-EXISTENTE em
message-content.tsx:64 — fora do escopo desta feature.)
…nderName
- EvoHubConnect: o criar-novo agora FINALIZA a criação da Instance. O botão
pós-OAuth ('Já autorizei, finalizar') chama linkExisting com o hub_channel_id
do canal recém-provisionado, reusando o caminho testado (resolve token +
phone_number_id server-side). Antes só fechava o diálogo sem criar nada.
- Guarda 422: se o usuário clicar antes de concluir o OAuth (canal sem
phone_number_id), toast pedindo para concluir e tentar de novo. disabled
durante o finalize evita double-create.
- Channel type fixado em WhatsApp (evolution-api é API de WhatsApp); removido
o seletor de tipo. available-channels e provision sempre whatsapp.
- i18n: chaves button.finalize + error.notAuthorizedYet nos 4 idiomas.
- fix pré-existente: message-content.tsx reaction senderName ('You' || x →
'You', comportamento idêntico) para destravar o type-check.
There was a problem hiding this comment.
Sorry @DavidsonGomes, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que é
Adiciona o EvoHub como 4ª opção de canal na criação de instância do manager-v2. EvoHub é um proxy transparente da Meta Cloud API — uma alternativa ao WhatsApp Cloud direto.
Os 3 canais existentes (Baileys, WhatsApp Business, Evolution) ficam idênticos — é só adição.
Fluxos (ambos funcionais)
public_linkpara autorizar a Meta → botão "Já autorizei, finalizar" cria a Instance reusando o link-existing.Mudanças
evolution.types.ts: shapes do contrato Hub (HubPlan, MetaAppOptions, HubChannel, EvoHubProvisionResponse).NewInstance.tsx: EVOHUB no enum Zod + options + render condicional<EvoHubConnect/>; esconde o Save global no EVOHUB (evita double-create).EvoHubConnect.tsx(novo): painel de conexão (modo novo/existente, shared/BYO, state machine). Channel type fixado em WhatsApp (evolution-api é API de WhatsApp).evohubService.ts(novo): serviço control-plane via apiGlobal (apikey global; nunca toca a API-key do hub).message-content.tsxreaction senderName ("You" || x→"You", comportamento idêntico) para destravar o type-check.Depende de
PR correspondente no evolution-api (endpoints control-plane
/evohub/*+ canal EvoHub no backend).Verificação
tsc --noEmit✅ ·vite build✅ · eslint ✅