Adicionada integração com a API Oficial do WhatsApp

This commit is contained in:
nestordavalos 2024-03-11 19:10:50 -03:00
parent b4ccaf0971
commit 21aa03b84e
4 changed files with 35 additions and 3 deletions

View File

@ -17,6 +17,26 @@
'Nome inválido (apenas letras, números, _ e -)', 'Nome inválido (apenas letras, números, _ e -)',
]" ]"
/> />
<v-select
v-model="instance.integration"
:items="['WHATSAPP-BAILEYS', 'WHATSAPP-BUSINESS']"
:label="$t('createInstance.integration')"
required
outlined
/>
<v-text-field
v-model="instance.number"
:label="$t('createInstance.number')"
outlined
v-if="instance.integration === 'WHATSAPP-BUSINESS'"
:rules="[
(v) =>
!!v || $t('required', { field: $t('createInstance.number') }),
(v) =>
new RegExp('^[a-zA-Z0-9_-]*$', 'i').test(v) ||
'Nome inválido (apenas letras, números, _ e -)',
]"
/>
<v-text-field <v-text-field
v-model="instance.token" v-model="instance.token"
label="API Key" label="API Key"
@ -72,6 +92,7 @@ export default {
instance: { instance: {
instanceName: "", instanceName: "",
token: "", token: "",
integration: "",
}, },
loading: false, loading: false,
error: false, error: false,
@ -106,6 +127,7 @@ export default {
this.error = false; this.error = false;
this.instance.instanceName = ""; this.instance.instanceName = "";
this.generateApiKey(); this.generateApiKey();
this.instance.integration = "";
}, },
}, },

View File

@ -52,6 +52,8 @@ export default {
title: "Create instance", title: "Create instance",
name: "Instance name", name: "Instance name",
configInfo: "The WebHook, WebSocket, RabbitMQ, Chatwoot, and Typebot can be configured after creating the instance.", configInfo: "The WebHook, WebSocket, RabbitMQ, Chatwoot, and Typebot can be configured after creating the instance.",
integration: "Integration",
number: "Telephone number identifier",
}, },
contribute: { contribute: {
title: "Contribute", title: "Contribute",
@ -70,7 +72,9 @@ export default {
}, },
connectPhone: { connectPhone: {
title: "Phone not connected", title: "Phone not connected",
apiGenericError: "Could not load QR Code, if the error persists, restart the API and try again." apiGenericError: "Could not load QR Code, if the error persists, restart the API and try again.",
qr: "QR Code",
code: "Código",
}, },
options: { options: {
title: "Behavior", title: "Behavior",

View File

@ -52,6 +52,8 @@ export default {
title: "Crear instancia", title: "Crear instancia",
name: "Nombre de la instancia", name: "Nombre de la instancia",
configInfo: "El WebHook, WebSocket, RabbitMQ, Chatwoot y Typebot se pueden configurar después de crear la instancia.", configInfo: "El WebHook, WebSocket, RabbitMQ, Chatwoot y Typebot se pueden configurar después de crear la instancia.",
integration: "Integración",
number: "Identificador de número de teléfono",
}, },
contribute: { contribute: {
title: "Contribuir", title: "Contribuir",
@ -70,7 +72,9 @@ export default {
}, },
connectPhone: { connectPhone: {
title: "Teléfono no conectado", title: "Teléfono no conectado",
apiGenericError: "No se pudo cargar el código QR. Si el error persiste, reinicie la API y vuelva a intentarlo.." apiGenericError: "No se pudo cargar el código QR. Si el error persiste, reinicie la API y vuelva a intentarlo..",
qr: "QR Code",
code: "Código",
}, },
options: { options: {
title: "Comportamiento", title: "Comportamiento",

View File

@ -19,7 +19,7 @@ export default {
noInstances: "Nenhuma instância encontrada", noInstances: "Nenhuma instância encontrada",
unknown: "Desconhecido", unknown: "Desconhecido",
required: "{field} é obrigatório", required: "{field} é obrigatório",
maxLength: "{field} deve ter no máximo {length} caracteres", maxLength: "{field} deve ter no máximo {length} caracteres",
https: "{field} deve começar com https://", https: "{field} deve começar com https://",
httpHttps: "{field} deve começar com http:// ou https://", httpHttps: "{field} deve começar com http:// ou https://",
enabled: "Habilitado", enabled: "Habilitado",
@ -52,6 +52,8 @@ export default {
title: "Criar instância", title: "Criar instância",
name: "Nome da instância", name: "Nome da instância",
configInfo: "O WebHook, WebSocket, RabbitMQ, Chatwoot e Typebot poderão ser configurados após a criação da instância.", configInfo: "O WebHook, WebSocket, RabbitMQ, Chatwoot e Typebot poderão ser configurados após a criação da instância.",
integration: "Integração",
number: "Identificador de número de telefone",
}, },
contribute: { contribute: {
title: "Contribuir", title: "Contribuir",