n8n-nodes-evolution-api
Advanced tools
Comparing version 0.1.20 to 0.1.21
@@ -42,11 +42,11 @@ "use strict"; | ||
{ | ||
name: 'Criar Instancia', | ||
value: 'create-instance', | ||
name: 'Instancia', | ||
value: 'instances-api', | ||
}, | ||
{ | ||
name: 'Buscar Instancia', | ||
value: 'fetch-instances', | ||
name: 'Mensagen', | ||
value: 'messages-api', | ||
}, | ||
], | ||
default: 'create-instance', | ||
default: 'instances-api', | ||
}, | ||
@@ -77,3 +77,3 @@ ...HttpVerbDescription_1.httpVerbOperations, | ||
} | ||
if (resource === 'create-instance' && operation === 'instance-basic') { | ||
if (resource === 'instances-api' && operation === 'instance-basic') { | ||
const credentials = await this.getCredentials('httpbinApi'); | ||
@@ -101,3 +101,3 @@ const serverUrl = credentials['server-url']; | ||
} | ||
if (resource === 'create-instance' && operation === 'instance-proxy') { | ||
if (resource === 'instances-api' && operation === 'instance-proxy') { | ||
const credentials = await this.getCredentials('httpbinApi'); | ||
@@ -137,2 +137,24 @@ const serverUrl = credentials['server-url']; | ||
} | ||
if (resource === 'messages-api' && operation === 'sendText') { | ||
const credentials = await this.getCredentials('httpbinApi'); | ||
const serverUrl = credentials['server-url']; | ||
const apiKey = credentials.apikey; | ||
const instance = this.getNodeParameter('instance', 0); | ||
const remoteJid = this.getNodeParameter('remoteJid', 0); | ||
const mensagem = this.getNodeParameter('mensagem', 0); | ||
const options = { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
apikey: apiKey, | ||
}, | ||
uri: `${serverUrl}/message/sendText/${instance}`, | ||
body: { | ||
number: remoteJid, | ||
text: mensagem, | ||
}, | ||
json: true, | ||
}; | ||
responseData = await this.helpers.request(options); | ||
} | ||
return [this.helpers.returnJsonArray(responseData)]; | ||
@@ -139,0 +161,0 @@ } |
@@ -12,3 +12,3 @@ "use strict"; | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
}, | ||
@@ -18,3 +18,3 @@ }, | ||
{ | ||
name: 'Instancia Basica', | ||
name: 'Criar Instancia Basica', | ||
value: 'instance-basic', | ||
@@ -37,6 +37,6 @@ description: 'Criar uma instancia basica', | ||
}, | ||
action: 'Instancia basica a create instance', | ||
action: 'Criar instancia basica an instances api', | ||
}, | ||
{ | ||
name: 'Instancia Com Proxy', | ||
name: 'Criar Instancia Com Proxy', | ||
value: 'instance-proxy', | ||
@@ -66,4 +66,19 @@ description: 'Criar uma instancia com Proxy', | ||
}, | ||
action: 'Instancia com proxy a create instance', | ||
action: 'Criar instancia com proxy an instances api', | ||
}, | ||
{ | ||
name: 'Buscar Instâncias', | ||
value: 'fetch-instances', | ||
description: 'Buscar instâncias existentes', | ||
routing: { | ||
request: { | ||
method: 'GET', | ||
url: '={{$credentials["server-url"].startsWith("https://") ? $credentials["server-url"] : "https://" + $credentials["server-url"]}}/instance/fetchInstances{{$parameter.instanceName ? "?instanceName=" + $parameter.instanceName : ""}}', | ||
headers: { | ||
apikey: '={{$credentials.apikey}}', | ||
}, | ||
}, | ||
}, | ||
action: 'Buscar inst ncias an instances api', | ||
}, | ||
], | ||
@@ -79,3 +94,3 @@ default: 'instance-basic', | ||
show: { | ||
resource: ['fetch-instances'], | ||
resource: ['messages-api'], | ||
}, | ||
@@ -85,4 +100,23 @@ }, | ||
{ | ||
name: 'Buscar Instâncias', | ||
value: 'fetch-instances', | ||
name: 'Enviar Texto', | ||
value: 'sendText', | ||
description: 'Enviar mensagem de texto', | ||
routing: { | ||
request: { | ||
method: 'POST', | ||
url: '={{$credentials["server-url"].startsWith("https://") ? $credentials["server-url"] : "https://" + $credentials["server-url"]}}/message/sendText/{{$parameter.instance}}', | ||
headers: { | ||
apikey: '={{$credentials.apikey}}', | ||
}, | ||
body: { | ||
number: '={{$node["Número"].number}}', | ||
text: '={{$node["Mensagem"].text}}', | ||
}, | ||
}, | ||
}, | ||
action: 'Enviar texto a messages api', | ||
}, | ||
{ | ||
name: 'Enviar Midia', | ||
value: 'sendMedia', | ||
description: 'Buscar instâncias existentes', | ||
@@ -98,6 +132,6 @@ routing: { | ||
}, | ||
action: 'Buscar inst ncias a fetch instances', | ||
action: 'Enviar midia a messages api', | ||
}, | ||
], | ||
default: 'fetch-instances', | ||
default: 'sendText', | ||
}, | ||
@@ -161,3 +195,3 @@ ]; | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-basic'], | ||
@@ -176,3 +210,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-basic'], | ||
@@ -200,3 +234,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-basic'], | ||
@@ -215,3 +249,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -230,3 +264,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -254,3 +288,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -269,3 +303,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -284,3 +318,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -308,3 +342,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -323,3 +357,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -339,3 +373,3 @@ }, | ||
show: { | ||
resource: ['create-instance'], | ||
resource: ['instances-api'], | ||
operation: ['instance-proxy'], | ||
@@ -358,2 +392,44 @@ }, | ||
}, | ||
{ | ||
displayName: 'Nome Da Instância', | ||
name: 'instanceName', | ||
type: 'string', | ||
default: '', | ||
required: true, | ||
description: 'Digite o nome da instância', | ||
displayOptions: { | ||
show: { | ||
resource: ['messages-api'], | ||
operation: ['sendText'], | ||
}, | ||
}, | ||
}, | ||
{ | ||
displayName: 'Numero Do Destinatario', | ||
name: 'remoteJid', | ||
type: 'string', | ||
default: '', | ||
required: true, | ||
description: 'RemoteJid do destinarario', | ||
displayOptions: { | ||
show: { | ||
resource: ['messages-api'], | ||
operation: ['sendText'], | ||
}, | ||
}, | ||
}, | ||
{ | ||
displayName: 'Mensagem', | ||
name: 'messageText', | ||
type: 'string', | ||
default: '', | ||
required: true, | ||
description: 'Digite a mensagem de texto que será enviado', | ||
displayOptions: { | ||
show: { | ||
resource: ['messages-api'], | ||
operation: ['sendText'], | ||
}, | ||
}, | ||
}, | ||
]; | ||
@@ -360,0 +436,0 @@ const deleteOperation = [ |
{ | ||
"name": "n8n-nodes-evolution-api", | ||
"version": "0.1.20", | ||
"version": "0.1.21", | ||
"description": "Api não oficial do WhatsApp", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
{ | ||
"name": "n8n-nodes-evolution-api", | ||
"version": "0.1.20", | ||
"version": "0.1.21", | ||
"description": "Api não oficial do WhatsApp", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69811
754