n8n-nodes-evolution-api
Advanced tools
Comparing version 0.1.23 to 0.1.24
@@ -54,2 +54,22 @@ "use strict"; | ||
...HttpVerbDescription_1.httpVerbFields, | ||
{ | ||
displayName: 'Nome Da Instância', | ||
name: 'instanceName', | ||
type: 'options', | ||
default: '', | ||
description: 'Selecione a instância que vai enviar a mensagem', | ||
displayOptions: { | ||
show: { | ||
resource: ['instances-api'], | ||
operation: ['fetch-instances'], | ||
}, | ||
}, | ||
options: [], | ||
routing: { | ||
send: { | ||
property: '={{$parameter.instanceName}}', | ||
type: 'query', | ||
}, | ||
}, | ||
}, | ||
], | ||
@@ -62,7 +82,6 @@ }; | ||
let responseData; | ||
if (resource === 'fetch-instances' && operation === 'fetch-instances') { | ||
if (resource === 'instances-api' && operation === 'fetch-instances') { | ||
const credentials = await this.getCredentials('httpbinApi'); | ||
const serverUrl = credentials['server-url']; | ||
const apiKey = credentials.apikey; | ||
const instanceName = this.getNodeParameter('instanceName', 0); | ||
const options = { | ||
@@ -73,6 +92,12 @@ method: 'GET', | ||
}, | ||
uri: `${serverUrl}/instance/fetchInstances${instanceName ? `?instanceName=${instanceName}` : ''}`, | ||
uri: `${serverUrl}/instance/fetchInstances`, | ||
json: true, | ||
}; | ||
responseData = await this.helpers.request(options); | ||
const instances = responseData.instances; | ||
const instanceOptions = instances.map((instance) => ({ | ||
name: instance.name, | ||
value: instance.id, | ||
})); | ||
return [this.helpers.returnJsonArray(instanceOptions)]; | ||
} | ||
@@ -79,0 +104,0 @@ if (resource === 'instances-api' && operation === 'instance-basic') { |
@@ -366,3 +366,3 @@ "use strict"; | ||
default: '', | ||
description: 'Digite o nome da instância', | ||
description: 'Digite o nome da instância que deseja pesquisar', | ||
displayOptions: { | ||
@@ -378,6 +378,5 @@ show: { | ||
name: 'instanceName', | ||
type: 'string', | ||
type: 'options', | ||
default: '', | ||
required: true, | ||
description: 'Digite o nome da instância', | ||
description: 'Selecione a instância que vai enviar a mensagem', | ||
displayOptions: { | ||
@@ -389,2 +388,9 @@ show: { | ||
}, | ||
options: [], | ||
routing: { | ||
send: { | ||
property: '={{$parameter.instanceName}}', | ||
type: 'query', | ||
}, | ||
}, | ||
}, | ||
@@ -391,0 +397,0 @@ { |
{ | ||
"name": "n8n-nodes-evolution-api", | ||
"version": "0.1.23", | ||
"version": "0.1.24", | ||
"description": "Api não oficial do WhatsApp", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
{ | ||
"name": "n8n-nodes-evolution-api", | ||
"version": "0.1.23", | ||
"version": "0.1.24", | ||
"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
71516
785